1
0
Fork 0

Rename AdafruitBLE to BluefruitLE (#16127)

This commit is contained in:
Ryan 2022-01-31 04:29:42 +11:00 committed by GitHub
parent 9f4769fbe6
commit 7d685956cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
35 changed files with 109 additions and 109 deletions

View file

@ -3,7 +3,7 @@
#include "timer.h"
#include "matrix.h"
#include "musical_notes.h"
#include "adafruit_ble.h"
#include "bluefruit_le.h"
float fauxclicky_pressed_note[2] = MUSICAL_NOTE(_A4, 0.0625);
float fauxclicky_released_note[2] = MUSICAL_NOTE(_A4, 0.0625);
@ -12,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 = adafruit_ble_read_battery_voltage() * 2 * 3.3 / 1024;
float voltage = bluefruit_le_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;