From 5ef3d8e819aaedd601a22533f62663eda9a3de52 Mon Sep 17 00:00:00 2001 From: Marc MERLIN Date: Thu, 17 Dec 2020 09:16:51 -0800 Subject: [PATCH 1/2] remove reference to temp, Display on a correct line I unfortunately wasted 1H trying to use the oled due to this example. Display lines need to be 9, 18, 27, 36, 45, 54 Using 33 is not good, it's an incorrect value that ends up in the wrong place, and gives the impression that you can give any Y coordinate, when in fact you cannot. If you don't, text gets overlayed on top of other text, even though it shouldn't according to Y See https://github.com/arduino-libraries/Arduino_SensorKit/pull/6 for an example. --- examples/Oled_Display/Oled_Display.ino | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/Oled_Display/Oled_Display.ino b/examples/Oled_Display/Oled_Display.ino index 0fa9842..f929f5e 100644 --- a/examples/Oled_Display/Oled_Display.ino +++ b/examples/Oled_Display/Oled_Display.ino @@ -9,10 +9,11 @@ void loop() { int random_value = random(0, 1023); // create a random value Oled.setFont(u8x8_font_chroma48medium8_r); - Oled.setCursor(0, 33); - Oled.print("Temp: "); - Oled.print(random_value); - Oled.print("C"); + // Y needs to be a multiple of 9 for a font of 8 or the display + // will end up in an incorrect place. + Oled.setCursor(0, 27); + Oled.print("Value: "); + Oled.print(random_value) Oled.refreshDisplay(); delay(1000); } From 141929e5b556bb254fe2ee9cfff19e3cd0a477a8 Mon Sep 17 00:00:00 2001 From: Marc MERLIN Date: Tue, 5 Jan 2021 14:17:36 -0800 Subject: [PATCH 2/2] fixes from noppatoppa --- examples/Oled_Display/Oled_Display.ino | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/examples/Oled_Display/Oled_Display.ino b/examples/Oled_Display/Oled_Display.ino index f929f5e..54a6d5d 100644 --- a/examples/Oled_Display/Oled_Display.ino +++ b/examples/Oled_Display/Oled_Display.ino @@ -9,11 +9,8 @@ void loop() { int random_value = random(0, 1023); // create a random value Oled.setFont(u8x8_font_chroma48medium8_r); - // Y needs to be a multiple of 9 for a font of 8 or the display - // will end up in an incorrect place. - Oled.setCursor(0, 27); + Oled.setCursor(0, 3); Oled.print("Value: "); Oled.print(random_value) - Oled.refreshDisplay(); delay(1000); }