mirror of
https://github.com/KevinMidboe/oled_workout_tracker.git
synced 2025-10-29 01:30:29 +00:00
Updated to also run on esp8266.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
// Rotary Encoder Inputs
|
// Rotary Encoder Inputs
|
||||||
#define CLK 2
|
#define CLK 13
|
||||||
#define DT 3
|
#define DT 12
|
||||||
#define SW 4
|
#define SW 14
|
||||||
|
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
int currentStateCLK;
|
int currentStateCLK;
|
||||||
|
|||||||
@@ -27,12 +27,24 @@
|
|||||||
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
|
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
|
||||||
|
|
||||||
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
|
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
|
||||||
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
|
#if defined(__AVR__)
|
||||||
|
#define OLED_RESET -1 // Reset pin # (or -1 if sharing Arduino reset pin)
|
||||||
|
#elif defined(ESP8266)
|
||||||
|
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
|
||||||
|
#endif
|
||||||
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
|
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
|
||||||
|
|
||||||
#define CLK 2
|
#if defined(__AVR__)
|
||||||
#define DT 3
|
// Arduino for any board with AVR architecture.
|
||||||
#define SW 4
|
#define CLK 2
|
||||||
|
#define DT 3
|
||||||
|
#define SW 4
|
||||||
|
#elif defined(ESP8266)
|
||||||
|
// ESP8266 Wemos D1
|
||||||
|
#define CLK 13 // D7
|
||||||
|
#define DT 12 // D6
|
||||||
|
#define SW 14 // D5
|
||||||
|
#endif
|
||||||
|
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
int currentStateCLK;
|
int currentStateCLK;
|
||||||
|
|||||||
Reference in New Issue
Block a user