Quote:
Originally Posted by nickdigger
The voltage levels would be stored in a PROGMEM array. After the VoltageLevel-to-ButtonBit conversion has happened, the rest of the button code should work as is. Eh, except for using the PINC interrupt as a trigger. We would simply read the voltage level at every timer2-overflow ISR, to detect a level change. I guess that would nullify your Sleep Mode thing, unless it's possible to use the Analog Comparator as a trigger. This is new to me.
|
Well, my code really doesn't have a sleep mode, as such. The code just tells the main program when the activity timeout occurs, so that the main program displays the system clock instead of whavever screen happened to be displayed before the activity timeout occurred.
But, yah, you could position the analog read inside the master timer (timer2 overflow) interrupt. That's what my code already does, anyway, with button debouncing. The PINC interrupt says that pins changed, and the master timer handles the debouncing and long-press detection.
Quote:
Originally Posted by nickdigger
Too bad this wasn't suggested and implemented from the beginning. Understandably, analog inputs and other hardware expansion were not on anyone's mind, when getting the basic Injector-Capture system working was a huge achievement in itself.
|
Yah, tell me about it. A few times, I wanted to mention the same thing, particularly with the LCD hardware choices that were made. Would have been nice to have stuck all of the LCD data bits onto one port, for instance; or to be able to read from the LCD hardware in addition to writing to it.