Skip to content

Commit cde0859

Browse files
committed
IO: Update I2CScreen example
Hardcode i2c interface, add background, fix indentation
1 parent 3e1c8de commit cde0859

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

java/libraries/io/examples/I2CScreen/I2CScreen.pde

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,14 @@ void setup() {
88

99
// the display can be set to one of these two addresses: 0x3c (default) or 0x3d
1010
// (they might be listed as 0x7a and 0x7b on the circuit board)
11-
oled = new SSD1306(I2C.list()[0], 0x3c);
11+
12+
// you might need to use a different interface on other SBCs
13+
oled = new SSD1306("i2c-1", 0x3c);
1214
}
1315

1416
void draw() {
15-
line(0, 0, 127, 63);
16-
line(0, 63, 127, 0);
17-
oled.sendImage(get());
17+
background(255);
18+
line(0, 0, 127, 63);
19+
line(0, 63, 127, 0);
20+
oled.sendImage(get());
1821
}

0 commit comments

Comments
 (0)