Adjustments for new Adafruit init routine, and confirm working with Nano Every/ATMega4809. Also whitespace tweaks (thanks Arduino IDE)

This commit is contained in:
Steve Howes
2022-07-19 12:13:44 +01:00
parent e74ceeb7f0
commit 6bf7c9b6e7
2 changed files with 364 additions and 364 deletions
+2 -1
View File
@@ -2,7 +2,8 @@
## Target Hardware ## Target Hardware
Arduino ATMega328p Arduino Nano ATMega328p
Arduino Nano Every ATMega4809 (Register emulation not required)
2.42 Inch SS1309 128x64 Monocrhome OLED 2.42 Inch SS1309 128x64 Monocrhome OLED
+3 -4
View File
@@ -48,7 +48,7 @@ const unsigned char PROGMEM logo_bmp [] = {
}; };
Adafruit_SSD1306 display(OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS); Adafruit_SSD1306 display(128, 64, OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
// Boot graphics and screen refresh // Boot graphics and screen refresh
int prettylinecount = 64; int prettylinecount = 64;
@@ -59,7 +59,7 @@ byte mode = 0; //(0 = bootlogo, 1 = running, 2 = calibrate)
// Pulse counting / pin state // Pulse counting / pin state
unsigned long pulsecount = 0; unsigned long pulsecount = 0;
byte lastspeedstate = 0; byte lastspeedstate = 0;
bytespeedstate = 0; byte speedstate = 0;
// Odometer and current mile pulses // Odometer and current mile pulses
unsigned long odometer = 0; unsigned long odometer = 0;
@@ -93,7 +93,7 @@ void setup()
Serial.setTimeout(10); Serial.setTimeout(10);
Serial.println(); Serial.println();
Serial.println(); Serial.println();
Serial.println("---- stevehowes/MX5-Arduino-Speed ----"); Serial.println("---- stevenhowes/MX5-Arduino-Speed ----");
display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //Initialize with the I2C address 0x3C. display.begin(SSD1306_SWITCHCAPVCC, 0x3C); //Initialize with the I2C address 0x3C.
@@ -360,4 +360,3 @@ void runmode()
lastspeedstate = speedstate; lastspeedstate = speedstate;
} }
} }