Dongbing Gu
/
ext_blinky
test
main.cpp
- Committer:
- dgu
- Date:
- 2017-01-11
- Revision:
- 0:61c1b97ace71
File content as of revision 0:61c1b97ace71:
#include "mbed.h" #include "TextLCD.h" SPI sw(p5, p6, p7); DigitalOut cs(p8); TextLCD lcd(p15, p16, p17, p18, p19, p20, TextLCD::LCD20x4); // rs, e, d4-d7 int main() { cs=0; sw.format(16,0); sw.frequency(1000000); lcd.printf("Hello World!\n"); while (1) { sw.write(0x0000); cs = 1; cs=0; wait(1); sw.write(0x5555); cs = 1; cs=0; wait(1); sw.write(0xAAAA); cs = 1; cs=0; wait(1); sw.write(0xFFFF); cs = 1; cs=0; wait(1); } }