summaryrefslogtreecommitdiff
path: root/libraries/MultiLCD/examples/lcdhello/lcdhello.ino
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/MultiLCD/examples/lcdhello/lcdhello.ino')
-rw-r--r--libraries/MultiLCD/examples/lcdhello/lcdhello.ino66
1 files changed, 60 insertions, 6 deletions
diff --git a/libraries/MultiLCD/examples/lcdhello/lcdhello.ino b/libraries/MultiLCD/examples/lcdhello/lcdhello.ino
index 55f07e5..cbfbc9b 100644
--- a/libraries/MultiLCD/examples/lcdhello/lcdhello.ino
+++ b/libraries/MultiLCD/examples/lcdhello/lcdhello.ino
@@ -1,20 +1,74 @@
+/*************************************************************************
+* Demo sketch of Arduino Text Display Library for Multiple LCDs
+* Distributed under GPL v2.0
+* Copyright (c) 2013 Stanley Huang <stanleyhuangyc@live.com>
+* All rights reserved.
+*************************************************************************/
+
#include <Arduino.h>
#include <Wire.h>
#include <MultiLCD.h>
-//LCD_OLED lcd; /* for I2C OLED module */
+LCD_SSD1306 lcd; /* for SSD1306 OLED module */
//LCD_PCD8544 lcd; /* for LCD4884 shield or Nokia 5100 screen module */
-LCD_1602 lcd; /* for LCD1602 shield */
+//LCD_1602 lcd; /* for LCD1602 shield */
+//LCD_ZTOLED lcd; /* for ZT OLED module */
+//LCD_ILI9325D lcd; /* for Itead 2.8" TFT shield */
+
+static const PROGMEM uint8_t smile[48 * 48 / 8] = {
+0x00,0x00,0x00,0x00,0x00,0x00,0x80,0xC0,0xE0,0xF0,0xF8,0xF8,0xFC,0xFC,0xFE,0xFE,0x7E,0x7F,0x7F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x3F,0x7F,0x7F,0x7E,0xFE,0xFE,0xFC,0xFC,0xF8,0xF8,0xF0,0xE0,0xC0,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
+0x00,0xC0,0xF0,0xFC,0xFE,0xFF,0xFF,0xFF,0x3F,0x1F,0x0F,0x07,0x03,0x01,0x00,0x80,0x80,0x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0x00,
+};
+
+#include "images.h"
void setup()
{
lcd.begin();
- lcd.setCursor(0, 0);
- lcd.print("Hello, World");
- lcd.setCursor(0, 1);
- lcd.printLarge("12345");
}
void loop()
{
+ //lcd.draw2x(frame0[0], 0, 124, 78, 58);
+ //lcd.draw2x(frame0[0], 164, 124, 78, 58);
+ //lcd.draw2x(frame0[0], 0, 0, 78, 58);
+ //lcd.draw2x(frame0[0], 164, 0, 78, 58);
+ lcd.clear();
+ lcd.draw(smile, 40, 0, 48, 48);
+ lcd.setCursor(0, 6);
+ lcd.setFont(FONT_SIZE_MEDIUM);
+ lcd.print("Microduino+BLE");
+
+ delay(3000);
+
+ lcd.clear();
+ lcd.setCursor(0, 0);
+ lcd.setFont(FONT_SIZE_SMALL);
+ lcd.print("Hello, world!");
+
+ lcd.setCursor(0, 1);
+ lcd.setFont(FONT_SIZE_MEDIUM);
+ lcd.print("Hello, world!");
+
+ lcd.setCursor(0, 3);
+ lcd.setFont(FONT_SIZE_SMALL);
+ lcd.printLong(12345678);
+
+ lcd.setCursor(64, 3);
+ lcd.setFont(FONT_SIZE_MEDIUM);
+ lcd.printLong(12345678);
+
+ lcd.setCursor(0, 4);
+ lcd.setFont(FONT_SIZE_LARGE);
+ lcd.printLong(12345678);
+
+ lcd.setCursor(0, 6);
+ lcd.setFont(FONT_SIZE_XLARGE);
+ lcd.printLong(12345678);
+
+ delay(3000);
}