khairul irwan fikri mohammad / Mbed 2 deprecated prac_test

Dependencies:   TextLCD mbed

Files at this revision

API Documentation at this revision

Comitter:
irwanfikri
Date:
Mon Jun 04 12:45:06 2018 +0000
Commit message:
pkatikalTest (ADCwithLCD&serial)

Changed in this revision

TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r b462604fdb57 TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Mon Jun 04 12:45:06 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/TextLCD/#308d188a2d3a
diff -r 000000000000 -r b462604fdb57 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Jun 04 12:45:06 2018 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "TextLCD.h"
+
+TextLCD lcd(D8, D9, D4, D5, D6, D7);
+Serial pc(USBTX, USBRX);
+DigitalIn switch1(PC_3);
+
+int x=0;
+int main() {
+    lcd.locate(0,0);
+    lcd.printf("embedded");
+    lcd.locate(2,1);
+    lcd.printf("subject");
+    pc.printf("embedded subject\n");
+    while(1) {
+        if(switch1 > 0.1f) {
+            for (x = 99; x > 65; x--){
+                lcd.locate(12,0);
+                lcd.printf("%d",x);
+                pc.printf("%d \n\r",x);
+                wait(0.5);
+                x=x-2;
+                if(switch1<0.1f){
+                    x=66;}
+                }
+            } 
+            else {
+            for (x = 99; x > 65; x--){
+                if(switch1>0.1f){
+                    x=66;}
+                lcd.locate(12,0);
+                lcd.printf("%d",x);
+                pc.printf("%d \n\r",x);
+                wait(0.5);
+                }
+        }
+        
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r b462604fdb57 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Jun 04 12:45:06 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/5aab5a7997ee
\ No newline at end of file