slave

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Supermil
Date:
Sun Dec 10 11:38:53 2017 +0000
Child:
1:72aaa085c985
Commit message:
slave;

Changed in this revision

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Dec 10 11:38:53 2017 +0000
@@ -0,0 +1,59 @@
+#include "mbed.h"
+
+DigitalIn B_UP(PB_13);
+DigitalIn B_OK(PB_14);
+DigitalIn B_DOWN(PB_15);
+DigitalIn B_ENTER(PB_1);
+DigitalIn B_CANCLE(PB_2);
+
+Serial lcd(PA_11,PA_12);
+Serial pc(D1,D0);
+
+Serial bt(D8,D2);
+int count_ok;
+char button;
+
+int main() {
+    count_ok = 0;
+    
+    while(1) {
+   
+        if(B_UP == 0){
+            bt.printf("U");
+//            wait_ms(500);
+        }
+        if(B_DOWN == 0){
+            bt.printf("D");
+//            wait_ms(500);
+        }
+        if(B_OK == 0){
+            bt.printf("O");
+//            wait_ms(500);
+        }
+        if(B_ENTER == 0){
+            bt.printf("E");
+        }
+        if(B_CANCLE == 0){
+            bt.printf("C");
+//            wait_ms(500);
+        } 
+//        if(lcd.readable()) {
+//            button = lcd.getc();
+//            pc.printf("%c",button);
+//        }
+//        lcd.puts("KUIPOP,POOP,PANCHALEE,HELLO WORLD\n ");
+
+//        lcd.printf("M");
+//        lcd.printf("I");
+//        lcd.printf("L");
+//        lcd.printf("L");
+//        lcd.printf("I");
+//        lcd.printf("O");
+//        lcd.printf("N");
+
+//        bt.printf("alphabet = %c",alphabet[state]);
+//        pc.printf("    state = %s    ",user_name);
+//        pc.printf("    size = %d \n",size);
+    }
+//    bt.printf("%s",user_name);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Dec 10 11:38:53 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e7ca05fa8600
\ No newline at end of file