diff options
| author | Selene ToyKeeper | 2017-08-25 02:14:31 -0600 |
|---|---|---|
| committer | Selene ToyKeeper | 2017-08-25 02:14:31 -0600 |
| commit | 39b30b41f92978a3e05a8de0a416279fb35b35b1 (patch) | |
| tree | ab349e516b72389820703e8eb7d4dbf4854875e6 /spaghetti-monster/fsm-adc.c | |
| parent | Started on some documentation, spaghetti-monster.txt. (diff) | |
| download | anduril-39b30b41f92978a3e05a8de0a416279fb35b35b1.tar.gz anduril-39b30b41f92978a3e05a8de0a416279fb35b35b1.tar.bz2 anduril-39b30b41f92978a3e05a8de0a416279fb35b35b1.zip | |
Added battcheck mode to ramping-ui. It's bigger than I had hoped. :(
Added fsm-misc.*, which currently only has interruptible blink functions in it.
(for blinking out numbers and such)
Diffstat (limited to 'spaghetti-monster/fsm-adc.c')
| -rw-r--r-- | spaghetti-monster/fsm-adc.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spaghetti-monster/fsm-adc.c b/spaghetti-monster/fsm-adc.c index 9a6e2e7..70e3bb3 100644 --- a/spaghetti-monster/fsm-adc.c +++ b/spaghetti-monster/fsm-adc.c @@ -263,4 +263,28 @@ ISR(ADC_vect) { #endif } +#ifdef USE_BATTCHECK +#ifdef BATTCHECK_4bars +PROGMEM const uint8_t voltage_blinks[] = { + 30, 35, 38, 40, 42, 99, +}; +#endif +#ifdef BATTCHECK_8bars +PROGMEM const uint8_t voltage_blinks[] = { + 30, 33, 35, 37, 38, 39 40, 41, 42, 99, +}; +#endif +void battcheck() { + #ifdef BATTCHECK_VpT + blink_num(voltage); + #else + uint8_t i; + for(i=0; + voltage >= pgm_read_byte(voltage_blinks + i); + i++) {} + blink_num(i); + #endif +} +#endif + #endif |
