TOP Contributors

  1. MIKROE (2650 codes)
  2. Alcides Ramos (350 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136538 times)
  2. FAT32 Library (69734 times)
  3. Network Ethernet Library (55842 times)
  4. USB Device Library (46178 times)
  5. Network WiFi Library (41801 times)
  6. FT800 Library (40989 times)
  7. GSM click (28922 times)
  8. PID Library (26384 times)
  9. mikroSDK (26280 times)
  10. microSD click (25298 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Library

ACH Thumbstick Click RPi Demo

Rating:

4

Author: Andrew Hazelden

Last Updated: 2014-10-22

Package Version: 1.0.0.0

Category: Gaming and Fun

Downloaded: 511 times

Followed by: 2 users

License: MIT license  

The python based thumbstick.py demo allows you to read a MikroElektronika Thumbstick Click board on a Raspberry PI using the GPIO and SPI inputs via a Pi Click Shield. The Thumbstick Click board uses an SPI based MCP3204 module for reading the joystick axes and the joystick "center click" button is read using the GPIO input 17 on the Raspberry Pi.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "ACH Thumbstick Click RPi Demo" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "ACH Thumbstick Click RPi Demo" changes.

Do you want to report abuse regarding "ACH Thumbstick Click RPi Demo".

  • Information
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
Other ARM Compilers
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Library Blog

Raspberry Pi and Thumbstick Click Board

Raspberry Pi and Thumbstick Click Board

The Thumbstick Click board is connected to a Raspberry Pi using the MikroE Pi Click Shield. This shield connects to the Raspberry PI GPIO header pins and lets you attach MikroBus format (http://www.mikroe.com/mikrobus/) Click boards.

View full image
Thumbstick Click

Thumbstick Click

The Thumbstick Click board uses an SPI based MCP3204 module for reading the joystick axes. The ADC0 channel is used for the y-axis and the ADC1 channel is used for the x-axis. The board is powered on 3.3 Volts from the GPIO header on the Raspberry PI.

View full image
Thumbstick Click Button

Thumbstick Click Button

The joystick "center click" button is read using the GPIO input 17 on the Raspberry Pi and has an inverted logic state where the button clicked=0, and the button unclicked=1. If you take the rubber joystick cap off the thumbstick you can see

View full image
Thumbstick.py Script

Thumbstick.py Script

Run the thumbstick.py demo script using " sudo python thumbstick.py". If the script runs correctly you will be presented with the following output in the terminal

View full image
Webiopi GPIO Header

Webiopi GPIO Header

You can use the webiopi webGUI to read the current GPIO pin state from a web browser. This is interesting as you can see the input and output mapping and see the binary state of each of the GPIO pins.

View full image
Webiopi Device Monitor

Webiopi Device Monitor

You can also watch the live values on the Thumbstick's 2 ADC channels (Joystick X & Y Axis) using the webiopi "Device Monitor" webpage.

View full image

ALSO FROM THIS AUTHOR

Snowburst Game

0

Tap to the screen to melt the falling snowflakes before you get snowed in. If you miss a snow flake the snowbank gets higher. Every 500 points the snowbank starts to melt a bit. You can play with two fingers but be sure to tap only one snowflake at a time. If you tap the status bar at the bottom of the screen you can mute the background music.

[Learn More]

mikroMMB PIC32 3D Accelerometer Demo

5

This firmware is a 3D demo for the accelerometer built into the mikromedia PIC32 board from MikroElektronika. The numbers onscreen are the tilt in degrees. The 3D axis view compass shows the orientation of the X, Y, and Z axes. The red line is the X axis, the green line is for the Y axis, and the blue line is the Z axis.

[Learn More]

PIC32 Soccer Bounce Demo

5

The Soccer Bounce demo uses the accelerometer input to roll a soccer ball around on a Mikromedia PIC32 screen. The code was written using MikroC Pro for PIC32 and VisualTFT. The soccer ball sprite graphics are rendered using Dragan Regodic's excellent TFT Graphics library: http://www.libstock.com/projects/view/914/tft-graphics-library

[Learn More]