mirror of
https://github.com/processing/processing4.git
synced 2026-01-27 10:21:26 +01:00
IO: Update I2CScreen example
Hardcode i2c interface, add background, fix indentation
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user