Repo_test

Dependencies:   4DGL-uLCD-SE mbed

Fork of uLCD_test by Jack Sugar

main.cpp

Committer:
slicht
Date:
2017-08-30
Revision:
1:cabfe6d67c62
Parent:
0:53bbc6d1d4de

File content as of revision 1:cabfe6d67c62:

// Demo for the uLCD-144-G2 based on the work by Jim Hamblen

#include "mbed.h"
#include "uLCD_4DGL.h"

uLCD_4DGL uLCD(p9,p10,p11); // serial tx, serial rx, reset pin;
 
int main()
{
    // basic printf demo = 16 by 18 characters on screen
    uLCD.printf("\nHello uLCD World\n"); //Default Green on black text
    uLCD.printf("\n  Starting Demo...");
    uLCD.text_width(4); //4X size text
    uLCD.text_height(4);
    uLCD.color(RED);
    for (int i=5; i>=0; --i) {
        uLCD.locate(1,2);
        uLCD.printf("%2D",i);
        wait(.5);
    }
    uLCD.cls();
    uLCD.printf("Change baudrate......");
    uLCD.baudrate(9600); //jack up baud rate to max for fast display
    //if demo hangs here - try lower baud rates

    wait(0.5);
    //demo graphics commands
    uLCD.background_color(BLACK);
    uLCD.cls();
    uLCD.background_color(DGREY);
    uLCD.filled_circle(60, 50, 30, 0xFF00FF);
    uLCD.triangle(120, 100, 40, 40, 10, 100, 0x0000FF);
    uLCD.line(0, 0, 80, 60, 0xFF0000);
    uLCD.filled_rectangle(50, 50, 100, 90, 0x00FF00);
    uLCD.pixel(60, 60, BLACK);
    uLCD.read_pixel(120, 70);
    uLCD.circle(120, 60, 10, BLACK);
    uLCD.set_font(FONT_7X8);
    uLCD.text_italic(ON);
    uLCD.text_mode(TRANSPARENT);
    uLCD.text_string("This", 1, 4, FONT_7X8, WHITE);
    wait(.5);
    uLCD.text_italic(ON);
    uLCD.text_string("STUFF", 8, 8, FONT_7X8, BLACK);
    wait(.5);
//    uLCD.text_width(2); //4X size text
//    uLCD.text_height(2);
    uLCD.text_string("Double ROCKS", 5, 13, FONT_7X8, RED);
    wait(200);
}