IO: Update I2CScreen example

Hardcode i2c interface, add background, fix indentation
This commit is contained in:
gohai
2017-04-03 18:18:46 +02:00
parent fb4b054bbe
commit 1df221200b

View File

@@ -8,11 +8,14 @@ void setup() {
// the display can be set to one of these two addresses: 0x3c (default) or 0x3d
// (they might be listed as 0x7a and 0x7b on the circuit board)
oled = new SSD1306(I2C.list()[0], 0x3c);
// you might need to use a different interface on other SBCs
oled = new SSD1306("i2c-1", 0x3c);
}
void draw() {
line(0, 0, 127, 63);
line(0, 63, 127, 0);
oled.sendImage(get());
background(255);
line(0, 0, 127, 63);
line(0, 63, 127, 0);
oled.sendImage(get());
}