aboutsummaryrefslogtreecommitdiffstats
path: root/keyboards/handwired/promethium/promethium.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/handwired/promethium/promethium.c')
-rw-r--r--keyboards/handwired/promethium/promethium.c3
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 @@
#include "timer.h"
#include "matrix.h"
#include "musical_notes.h"
+#include "adafruit_ble.h"
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625);
float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625);
@@ -11,7 +12,7 @@ float fauxclicky_beep_note[2] = MUSICAL_NOTE(_C6, 0.25);
// 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}
uint8_t battery_level(void) {
- float voltage = analogRead(BATTERY_PIN) * 2 * 3.3 / 1024;
+ float voltage = adafruit_ble_read_battery_voltage() * 2 * 3.3 / 1024;
if (voltage < MIN_VOLTAGE) return 0;
if (voltage > MAX_VOLTAGE) return 255;
return (voltage - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE) * 255;