Created
February 4, 2020 13:41
-
-
Save atotto/be94e44b72c614dca84ccc395554590e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <GxEPD2_BW.h> | |
#include <Fonts/FreeMonoBold9pt7b.h> | |
#define EPD_CS SS | |
GxEPD2_BW<GxEPD2_213_B73, GxEPD2_213_B73::HEIGHT> display(GxEPD2_213_B73(/*CS=5*/ SS, /*DC=*/ 17, /*RST=*/ 16, /*BUSY=*/ 4)); // GDEH0213B73 | |
#define BAT 35 | |
void setup() { | |
pinMode(BAT, INPUT); | |
//float volt = (long)analogRead(BAT) * 3300. / 4096. * 2. ; | |
float volt = (long)analogRead(BAT) * 3600. / 4095. * 2. ; | |
display.init(115200); | |
display.firstPage(); | |
do | |
{ | |
display.setFont(&FreeMonoBold9pt7b); | |
display.setTextColor(GxEPD_BLACK); | |
display.setFullWindow(); | |
display.setCursor(0, 10); | |
display.print(String((long)volt) + " mV"); | |
} | |
while (display.nextPage()); | |
display.hibernate(); | |
} | |
void loop(void) { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment