Using analog joystick in AVR projects

joystick

In many cases joystick manipulator is best choice for user input. Whether it is a game, robot or flying machine – joystick is most intuitive way of controlling them. You can actually find them in gaming controllers like PlayStation or XBOX. The one we are going to interface is Thumb Joystick I purchased some time ago from SparkFun. They are really cheap and as users report it is practically same as in XBOX 360 which can be replaces if one is broken. I didn’t bother making a PCB for it – just used a breakout board for it which also can be found on SparkFun. Simply speaking this joystick is nothing more than two potentiometers and one pushbutton. It is designed so that potentiometers are oriented perpendicular and thus moving stick you can have X and Y axis control. Push button is simply action button which can be activated by pressing joystick down. So controlling joystick is a matter of analog read of both potentiometers with microcontroller ADC inputs.

Continue reading