Hello sur OLED
This commit is contained in:
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); */
|
||||
|
||||
}
|
Reference in New Issue
Block a user