Dependencies:   mbed

Revision:
0:bfb11ea418eb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 15 18:05:10 2018 +0000
@@ -0,0 +1,29 @@
+/ host terminal LED dimmer control
+
+#include "mbed.h"
+#include "C12832.h"
+
+C12832 lcd(p5, p7, p6, p8, p11);
+
+PwmOut led(LED1);
+float brightness=0.0;
+int main()
+{
+    lcd.locate(0,0);
+    lcd.printf(“Control of LED dimmer by host terminal\n\r");
+
+               lcd.locate(0,10);
+               lcd.printf("Press 'u‘ = brighter, 'd‘ = dimmer\n\r");
+
+                       while(1) { char c = pc.getc(); wait(0.001);
+
+                       if((c == 'u') && (brightness < 0.1))
+                   { brightness += 0.001; led = brightness; }
+                       if((c == 'd') && (brightness > 0.0))
+                   { brightness -= 0.001; led = brightness; }
+
+
+                       lcd.locate(0,20);
+                       lcd.printf("%c %1.3f \n \r",c,brightness); }
+                   }
+