From 65e010aa0b9c3f0fd9e9cef4f81ccdd1e21a1afd Mon Sep 17 00:00:00 2001 From: msekar Date: Wed, 20 Jan 2016 23:20:42 +0100 Subject: [PATCH] Adafruit OLED display 128x32 --- oled_disp.ino | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+), 0 deletions(-) create mode 100644 oled_disp.ino diff --git a/oled_disp.ino b/oled_disp.ino new file mode 100644 index 0000000..fac9672 --- /dev/null +++ b/oled_disp.ino @@ -0,0 +1,23 @@ +void init_disp(){ + Serial.begin(9600); + Serial.println("Button checker"); + display.begin(SSD1306_SWITCHCAPVCC, 0x3C); // initialize with the I2C addr 0x3C (for the 128x32) + display.display(); + display.clearDisplay(); + scrolltext(lap); + display.clearDisplay(); +} + + +void scrolltext(int lap) { + display.setTextSize(2); + display.setTextColor(WHITE); + display.setCursor(2,0); + display.clearDisplay(); + display.print("Lap : "); + display.println(lap); + display.display(); + delay(1); + display.startscrollleft(0x00, 0x0F); + +} -- libgit2 0.21.2