This was my first time using a resistor ladder to read buttons off an ADC pin. It works great! The only mistake I made initially was tried to use the 1.1v internal reference.
Calibrated button presses at 5v, then tried at 3.3v and they were all off...
The solution was to use VCC as reference which is default for ADC. Then you get the ratio compared to VCC and if that voltage is changing, your button presses will be consistant.
Currently my idea on having the RUN button also be the STOP button is having it at the end of the resistor ladder. It will return a low enough voltage to be logic 0. When a program is running, PB4 will have an interrupt set. If it is triggered LOW, then the program will end and buttons will be set back to reading as ADC input like normal.
I am also considering making button presses accessable by the interpreter. But it all depends on how much memory i have left after implimenting the basics.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.