Update
This commit is contained in:
parent
317bea64ff
commit
f4cf5f4616
@ -7,7 +7,7 @@
|
||||
#include "Arduino.h"
|
||||
|
||||
#include "LowPower.h"
|
||||
#include <avr/wdt.h>
|
||||
//#include <avr/wdt.h>
|
||||
|
||||
#define SCREEN_WIDTH 128
|
||||
#define SCREEN_HEIGHT 32
|
||||
@ -114,13 +114,6 @@ static const int dimmerVals[] = {
|
||||
};
|
||||
|
||||
void setup() {
|
||||
delay(100);
|
||||
wdt_enable(WDTO_8S);
|
||||
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
|
||||
display.clearDisplay();
|
||||
display.setTextColor(WHITE);
|
||||
Wire.begin();
|
||||
Serial.begin(9600);
|
||||
pinMode(VBAT, INPUT);
|
||||
pinMode(CSTAT1, INPUT);
|
||||
pinMode(CSTAT2, INPUT);
|
||||
@ -129,19 +122,30 @@ void setup() {
|
||||
pinMode(CHGLED, OUTPUT);
|
||||
pinMode(PWRBTN, INPUT_PULLUP);
|
||||
pinMode(CHGBTN, INPUT_PULLUP);
|
||||
digitalWrite(PWRLED, HIGH);
|
||||
digitalWrite(CHGLED, HIGH);
|
||||
delay(100);
|
||||
// wdt_enable(WDTO_8S);
|
||||
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
|
||||
display.clearDisplay();
|
||||
display.setTextColor(WHITE);
|
||||
Wire.begin();
|
||||
// Serial.begin(9600);
|
||||
digitalWrite(FETCTRL, LOW);
|
||||
resetScreen();
|
||||
delay(200);
|
||||
FuelGauge.begin();
|
||||
FuelGauge.reset(); //<== Might cause problems
|
||||
FuelGauge.quickstart();
|
||||
digitalWrite(PWRLED, LOW);
|
||||
digitalWrite(CHGLED, LOW);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
delay(100);
|
||||
delay(900);
|
||||
Serial.println(getVoltage());
|
||||
wdt_reset();
|
||||
// Serial.println(getVoltage());
|
||||
// wdt_reset();
|
||||
checkPresses();
|
||||
checkCharging();
|
||||
safetyCheck();
|
||||
@ -255,6 +259,7 @@ void updateScreen(){
|
||||
screenOn = true;
|
||||
}
|
||||
|
||||
|
||||
void updateDisplayChg(){
|
||||
display.clearDisplay();
|
||||
updateDispayHelper();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user