From 07c3bf5f25e20e865ed3dd83a17bde4c76e1cd1c Mon Sep 17 00:00:00 2001 From: Zion Orent Date: Fri, 5 Dec 2014 08:58:39 -0500 Subject: [PATCH] ssd1327: Modifying C++ example Signed-off-by: Zion Orent Signed-off-by: Jon Trulson Signed-off-by: Sarah Knepper --- examples/oled-1327.cxx | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/examples/oled-1327.cxx b/examples/oled-1327.cxx index 6affaf37..9e12fc77 100644 --- a/examples/oled-1327.cxx +++ b/examples/oled-1327.cxx @@ -107,18 +107,20 @@ int main(int argc, char **argv) { //! [Interesting] - upm::SSD1327 *lcd = new upm::SSD1327(BUS_NUMBER, 0x3C); + upm::SSD1327 *lcd = new upm::SSD1327(BUS_NUMBER, 0x3C); - // Simple print hello world - for (uint8_t i = 0; i < 12; i++) { - lcd->setCursor(i, 0); - lcd->setGrayLevel(i); - lcd->write("Hello World"); - } + // If you don't set the display to be white, the seeed logo will appear jagged + lcd->setGrayLevel(12); + lcd->draw(SeeedLogo, 96 * 96 / 8); - // Simple print hello world - lcd->draw(SeeedLogo, 96 * 96 / 8); + // Simple print hello world + for (uint8_t i = 0; i < 12; i++) + { + lcd->setCursor(i, 0); + lcd->setGrayLevel(i); + lcd->write("Hello World"); + } - lcd->close(); + lcd->close(); //! [Interesting] }