Simon Ford
/
NokiaLCD_HelloWorld
Hello World Example for the Nokia LCD library
main.cpp@1:823d052d5150, 2010-11-19 (annotated)
- Committer:
- simon
- Date:
- Fri Nov 19 22:16:33 2010 +0000
- Revision:
- 1:823d052d5150
- Parent:
- 0:fd3c4e179035
Set for newest sparkfun breakout
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
simon | 1:823d052d5150 | 1 | // Hello World! for Nokia LCD, sford |
simon | 1:823d052d5150 | 2 | // - LCD6610 is for newest Sparkfun breakout |
simon | 1:823d052d5150 | 3 | |
simon | 0:fd3c4e179035 | 4 | #include "mbed.h" |
simon | 0:fd3c4e179035 | 5 | #include "NokiaLCD.h" |
simon | 0:fd3c4e179035 | 6 | |
simon | 1:823d052d5150 | 7 | NokiaLCD lcd(p5, p7, p8, p9, NokiaLCD::LCD6610); // mosi, sclk, cs, rst, type |
simon | 0:fd3c4e179035 | 8 | |
simon | 0:fd3c4e179035 | 9 | int main() { |
simon | 0:fd3c4e179035 | 10 | lcd.background(0x0000FF); |
simon | 0:fd3c4e179035 | 11 | lcd.cls(); |
simon | 0:fd3c4e179035 | 12 | lcd.fill(2, 51, 128, 10, 0x00FF00); |
simon | 0:fd3c4e179035 | 13 | lcd.fill(50, 1, 10, 128, 0xFF0000); |
simon | 0:fd3c4e179035 | 14 | lcd.locate(0,3); |
simon | 0:fd3c4e179035 | 15 | lcd.printf("Hello World!"); |
simon | 0:fd3c4e179035 | 16 | for (int i=0; i<130; i++) { |
simon | 0:fd3c4e179035 | 17 | lcd.pixel(i, 80 + sin((float)i / 5.0)*10, 0x000000); |
simon | 0:fd3c4e179035 | 18 | } |
simon | 0:fd3c4e179035 | 19 | } |