Toyomasa Watarai
/
PCF8576_GH08172_test
NXP PCF8576 + GH08172_test program
Diff: main.cpp
- Revision:
- 0:32964eaccde0
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Mar 28 12:42:32 2016 +0000 @@ -0,0 +1,36 @@ +/* + * PCF8576 + GH08172 LCD test program + */ + +#include "mbed.h" +#include "PCF8576.h" + +PCF8576 lcd(D14, D15); +Ticker flipper; + +void blink() +{ + static uint32_t cnt = 0; + const uint32_t ptn[5] = {0, 1, 3, 7, 0xF}; + + if (cnt > 4) { + cnt = 0; + } + lcd.icon(ptn[cnt++]); +} + +int main() +{ + char buf[6]; + flipper.attach(&blink, 0.4); + + lcd.print("mbed"); + wait(5); + + int cnt = 0; + while(1) { + sprintf(buf, "%6d", cnt++); + lcd.print(buf); + wait(0.1); + } +}