diff --git a/platformio.ini b/platformio.ini index 993dc81..32fc407 100644 --- a/platformio.ini +++ b/platformio.ini @@ -11,4 +11,7 @@ [env:esp32cam] platform = espressif32 board = esp32cam -framework = arduino \ No newline at end of file +framework = arduino +lib_deps = + poma/OLED_I2C @ ^2.12 + diff --git a/src/main.cpp b/src/main.cpp index 19691e5..cb3ae26 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,19 +1,31 @@ #include +//#include +#include +#define SDA 12 +#define SCL 13 + +OLED myOLED(SDA, SCL); +extern uint8_t SmallFont[]; -// Un petit Hello world pour valider les bases #define LED_FLASH 4 #define LED_BUILTIN 33 - -#define MyLED LED_BUILTIN +#define MyLED LED_FLASH void setup() { pinMode(MyLED, OUTPUT); + + myOLED.begin(SSD1306_128X32); + myOLED.setFont(SmallFont); + myOLED.clrScr(); + myOLED.print("Hello, world!", CENTER, 0); + myOLED.update(); } void loop() { - digitalWrite(MyLED, HIGH); - delay(1000); + /*digitalWrite(MyLED, HIGH); + delay(10); digitalWrite(MyLED, LOW); - delay(1000); + delay(990); */ + } \ No newline at end of file