test
Dependencies: NokiaLCD_6100_o mbed
Diff: main.cpp
- Revision:
- 0:7797ffbe95fe
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Apr 19 08:19:26 2017 +0000 @@ -0,0 +1,31 @@ +#include "mbed.h" +#include "NokiaLCD.h" + +NokiaLCD lcd(p5, p7, p8, p9, NokiaLCD::PCF8833); // mosi, sclk, cs, rst, type +// 橙 白 緑 紫 +int main() { + int bgcolor=0; + lcd.background(0x0000FF); + while(1){ + + switch(bgcolor++) + { + case 0 :lcd.background(0x800000); break; + case 1 :lcd.background(0x008000); break; + case 2 :lcd.background(0x000080); bgcolor=0; break; + } + + lcd.cls(); + lcd.fill(1, 20, 128, 10, 0x00ff00); // 緑 + lcd.fill(0, 70, 130, 10, 0x0000ff); // 青 + lcd.fill(50, 1, 10, 128, 0xFF0000); // 赤 + for(int i=0; i<3; i++) { + lcd.locate(0,i+12); + lcd.printf("Hello World!miz%d", i); + } + for (int i=0; i<130; i++) { + lcd.pixel(i, 60 + sin((float)i / 5.0)*10, 0xffffff); + } + wait_us(33333); + } +} \ No newline at end of file