Migrating to U8G2

This commit is contained in:
2023-08-01 01:02:41 +03:00
parent 72093d7d20
commit 21e67180ec
2 changed files with 109 additions and 108 deletions

View File

@ -1,9 +1,10 @@
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
//#include <Adafruit_GFX.h>
//#include <Adafruit_SSD1306.h>
#include <RotaryEncoder.h>
#include <FlexiTimer2.h>
#include <EEPROM.h>
#include <U8g2lib.h>
#define VERSION "0.9b"
@ -120,7 +121,7 @@ bool encPressRegistered;
//unsigned long lastInteractionTime; // used for display timeout
Adafruit_SSD1306 display(128, 64, &Wire, -1);
U8G2_SSD1306_128X64_NONAME_2_HW_I2C u8g2(U8G2_R2, SCL, SDA, U8X8_PIN_NONE);
RotaryEncoder encoder(ENC_D1_PIN, ENC_D2_PIN, RotaryEncoder::LatchMode::TWO03);
const unsigned char splash_logo[] PROGMEM = {
@ -176,7 +177,7 @@ void setup() {
pinMode(outsPins[i], OUTPUT);
}
display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS);
/*display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS);
display.setRotation(2);
display.clearDisplay();
@ -189,7 +190,9 @@ void setup() {
display.print(F("V:"));
display.print(F(VERSION));
display.display();
delay(800);
delay(800);*/
//u8g2.setI2CAddress(SCREEN_ADDRESS);
u8g2.begin();
updateScreen();
calculateCycles();