test

Dependencies:   TextLCD mbed

Revision:
0:61c1b97ace71
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jan 11 13:59:59 2017 +0000
@@ -0,0 +1,32 @@
+#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);
+   }
+}
+