acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

GetChargeLevel.ino (636B)

      1 #include <Pangodream_18650_CL.h>
      2 
      3 //#define ADC_PIN 34
      4 //#define CONV_FACTOR 1.7
      5 //#define READS 20
      6 
      7 Pangodream_18650_CL BL;
      8 /**
      9  * If you need to change default values you can use it as
     10  * Pangodream_18650_CL BL(ADC_PIN, CONV_FACTOR, READS);
     11  */
     12 
     13 void setup() {
     14   Serial.begin(115200);
     15 }
     16 
     17 void loop() {
     18   Serial.print("Value from pin: ");
     19   Serial.println(analogRead(34));
     20   Serial.print("Average value from pin: ");
     21   Serial.println(BL.pinRead());
     22   Serial.print("Volts: ");
     23   Serial.println(BL.getBatteryVolts());
     24   Serial.print("Charge level: ");
     25   Serial.println(BL.getBatteryChargeLevel());
     26   Serial.println("");
     27   delay(1000);
     28 }