From 1df221200bf14068b27071bd01cccf42eda66de7 Mon Sep 17 00:00:00 2001 From: gohai Date: Mon, 3 Apr 2017 18:18:46 +0200 Subject: [PATCH] IO: Update I2CScreen example Hardcode i2c interface, add background, fix indentation --- java/libraries/io/examples/I2CScreen/I2CScreen.pde | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/java/libraries/io/examples/I2CScreen/I2CScreen.pde b/java/libraries/io/examples/I2CScreen/I2CScreen.pde index 71a761598..6f6f6bdd0 100644 --- a/java/libraries/io/examples/I2CScreen/I2CScreen.pde +++ b/java/libraries/io/examples/I2CScreen/I2CScreen.pde @@ -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()); }