Introduction to Joysticks
Today, I’m going to show you a little bit more of the joystick with an Arduino and what exactly a deadzone is. Let’s hop right in! A deadzone lets you see into people’s future and tell if they’re going to be the next Hitler or not. Wait, no, hold on. That’s the Stephen King novel. Let me start again.
Programming-wise, a deadzone is a region at the center of the joystick that is not recognized by the device. What’s this mean? On most joysticks, there’s going to be a small area where moving the stick does not result in movement of the device. This deadzone area varies from model to model, but it can usually be adjusted. Let’s play with that today.
Take a look at the joystick we get to play with. It’s fairly similar to the kind you’ll see on your XBOX or PS3 controller. It’s got an x-axis, a y-axis, and if you push straight down you get a button. You’ll remember that we used this joystick in our tetris game.
(more…)