As you may have noticed I have been prototyping my system on an Arduino Pro Mini rather than a Trinket Pro so far.
Although the system is the same on many levels there are a few distinct differences that need to be accounted for.
- The Trinket Pro has a USB bootloader in the firmware that reduces the usable code size by ~3kB
- The Trinket Pro uses 1 of the 2 external interrupts for USB
- Not all pins are avaiable on the Trinket Pro
Number 2 is the big one I didn't take into account so far in my code. I use an interrupt for reading the rotary encoder and another for reading a button press. After I realized this I was worried that I would need to start continually polling the inputs in a loop rather than using the external interrupts, but I have been saved!
It ends up you can set up an interrupt on any of the IO ports of the microcontroller. This means I can hook up all my inputs to a single port, interrupt on any change to that port, and then actually read each of the inputs to see what happened. More information on how to set up this type of interrupt is available at http://www.geertlangereis.nl/Electronics/Pin_Change_Interrupts/PinChange_en.html
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
Are you sure? yes | no
Are you sure? yes | no