Hello sur OLED
This commit is contained in:
parent
11f24c9e23
commit
434e49d8d8
@ -12,3 +12,6 @@
|
||||
platform = espressif32
|
||||
board = esp32cam
|
||||
framework = arduino
|
||||
lib_deps =
|
||||
poma/OLED_I2C @ ^2.12
|
||||
|
||||
|
24
src/main.cpp
24
src/main.cpp
@ -1,19 +1,31 @@
|
||||
#include <Arduino.h>
|
||||
//#include <Wire.h>
|
||||
#include <OLED_I2C.h>
|
||||
|
||||
#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); */
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user