JoystickShield is an Arduino library that can be used with JoystickShield.
The library supports both event based (callback mode) and the normal mode. Refer to the examples to find out how to use the library in both the modes.
The library supports the following events
- All 8 directions of Joystick. (Up, RightUp, Right, RightDown, Down, LeftDown, Left and LeftUp)
- Joystick button press
- All 4 button press (Up, Right, Down, Left)
The library has two examples sketches which explains the modes
- SimpleExample – Shows the normal way of using the library
- CallbackExample – Shows how to use the library in callback mode.
You can download the library from my github page. The examples are there inside the /examples folder. After downloading place the JoystickShield folder inside your Arduino’s /library folder
The library and the example are released under released under BeerWare license.
I would, however, consider it a great courtesy if you could email me and tell me about your project and how this code was used, just for my own continued personal gratification 🙂
You can also find other ways to make me happy, if you liked this project.
I would be posting updates about this library in my blog and in Twitter. If you want to be informed when new version of this library is released, then you can either subscribe to this blog’s RSS feed or follow me in Twitter.
- 2011-04-08 – v0.1 – Initial version
- 2012-05-19 – v0.2 – Added compatibility for Arduino 1.0
It would be nice if there was a way to see how far in a direction the joystick is being moved. Otherwise, great work!
Will add it to my todo list 🙂
Your joystick library was very helpful in helping me debug an issue I was having while using the joystick shield to develop code for a singing animatronic head: http://www.jiggywatts.com/technology/teaching-the-starbot-to-sing/
Glad to know that my library was useful to you and all the best for your project.