jim hamblen / Mbed 2 deprecated RPG_demo

Dependencies:   mbed PinDetect

You are viewing an older revision! See the latest version

Homepage

This is a demo for Sparkfun's RPG with RGB led using interrupts to read the encoder signal. See comments in main.cpp for more details and pin hookups. The RPG is mounted on Sparkfun's breakout board. The code uses the encoder count to dim the built-in LED using PWM. The RPG's shaft pushbutton is also debounced using interrupts.

https://os.mbed.com/media/uploads/4180_1/rpg_skNKbNa.jpg

The header pins are spaced so far apart that all of the jumper wire pins are under the PCB in the normal breadboard locations for an IC, but if you put in across a power bus (power bus under middle of PCB) as seen in the photo below, you will have room to connect the jumper wires after inserting the breakout (otherwise pins for jumper wires are all under the breakout board).

https://os.mbed.com/media/uploads/4180_1/20220118_141642.jpg

Parts used:

https://www.sparkfun.com/products/15141 https://www.sparkfun.com/products/11722 https://www.sparkfun.com/products/10597

See http://makeatronics.blogspot.com/2013/02/efficiently-reading-quadrature-with.html for a detailed explanation of the RPG encoder counting algorithm using interrupts with a lookup table.


All wikipages