diff options
Diffstat (limited to 'keyboards/handwired/promethium/promethium.c')
| -rw-r--r-- | keyboards/handwired/promethium/promethium.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c index 3cc0f5a8c..96bcf3ce1 100644 --- a/keyboards/handwired/promethium/promethium.c +++ b/keyboards/handwired/promethium/promethium.c | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | #include "timer.h" | 3 | #include "timer.h" |
| 4 | #include "matrix.h" | 4 | #include "matrix.h" |
| 5 | #include "musical_notes.h" | 5 | #include "musical_notes.h" |
| 6 | #include "adafruit_ble.h" | ||
| 6 | 7 | ||
| 7 | float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625); | 8 | float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625); |
| 8 | float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625); | 9 | float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625); |
| @@ -11,7 +12,7 @@ float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 0.25); | |||
| 11 | // cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100} | 12 | // cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100} |
| 12 | 13 | ||
| 13 | uint8_t battery_level(void) { | 14 | uint8_t battery_level(void) { |
| 14 | float voltage = analogRead(BATTERY_PIN) * 2 * 3.3 / 1024; | 15 | float voltage = adafruit_ble_read_battery_voltage() * 2 * 3.3 / 1024; |
| 15 | if (voltage < MIN_VOLTAGE) return 0; | 16 | if (voltage < MIN_VOLTAGE) return 0; |
| 16 | if (voltage > MAX_VOLTAGE) return 255; | 17 | if (voltage > MAX_VOLTAGE) return 255; |
| 17 | return (voltage - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE) * 255; | 18 | return (voltage - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE) * 255; |
