Hello World Example for the Nokia LCD library

Dependencies:   mbed NokiaLCD

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 // Hello World! for Nokia LCD, sford
00002 // - LCD6610 is for newest Sparkfun breakout
00003 
00004 #include "mbed.h"
00005 #include "NokiaLCD.h"
00006 
00007 NokiaLCD lcd(p5, p7, p8, p9, NokiaLCD::LCD6610); // mosi, sclk, cs, rst, type
00008 
00009 int main() {
00010     lcd.background(0x0000FF);
00011     lcd.cls();
00012     lcd.fill(2, 51, 128, 10, 0x00FF00);
00013     lcd.fill(50, 1, 10, 128, 0xFF0000);
00014     lcd.locate(0,3);
00015     lcd.printf("Hello World!");
00016     for (int i=0; i<130; i++) {
00017         lcd.pixel(i, 80 + sin((float)i / 5.0)*10, 0x000000);
00018     }
00019 }