const bool zero[7] = {true, true, true, true, true, true, false};
const bool U[7] = {false, true, true, true, true, true, false};
-const bool I[7] = {false, false, true, false, false, false, false};
-const bool P[7] = {true, true, false, false, true, true, true};
+const bool A[7] = {true, true, true, false, true, true, true};
+const bool E[7] = {true, false, false, true, true, true, true};
unsigned char display_state = 0;
}
for (int i = 0; i < 7; ++i) {
if (segs[i]) {
- digitalWrite(segments[i], HIGH);
+ digitalWrite(segments[i], HIGH);
} else {
digitalWrite(segments[i], LOW);
}
writeDigit(2, cvolts % 10, false);
writeLetter(3, U);
}
+
void showCurrent(float current) {
int camp = current * 100;
writeDigit(0, (camp/100U) % 10, true);
writeDigit(1, (camp/10U) % 10, false);
writeDigit(2, camp % 10, false);
- writeLetter(3, I);
+ writeLetter(3, A);
}
void showWh(float watthours) {
writeDigit(0, (w/1000U) % 10, true);
writeDigit(1, (w/100U) % 10, false);
writeDigit(2, (w/10U) % 10, false);
- writeLetter(3, P);
+ writeLetter(3, E);
}
pinMode(15, OUTPUT);
digitalWrite(15, LOW);
- pinMode(19, INPUT);
- pinMode(20, INPUT);
- pinMode(21, INPUT);
+ pinMode(19, INPUT_PULLUP);
+ pinMode(20, INPUT_PULLUP);
+ pinMode(21, INPUT_PULLUP);
}
void loop() {