L432KCIM

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Takagisyuiti
Date:
Thu Jan 13 06:56:27 2022 +0000
Commit message:
L432KCIM

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
diff -r 000000000000 -r 0881a71b392b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Jan 13 06:56:27 2022 +0000
@@ -0,0 +1,39 @@
+#include "mbed.h"
+#include "Serial.h"
+Serial device(PA_2,PA_3);
+DigitalOut led(LED1);
+
+char str[10];
+
+void getC(){
+    int i=0;
+    char command=device.getc();
+    if(command=='A'||'a'){
+        while(i<5){    
+            led=1;
+            wait(0.5);
+            i++;
+        }        
+    }else if(command=='B'||'b'){
+        while(i<5){    
+            led=1;
+            wait(1);
+            i++;
+        }    
+    }else if(command=='C'||'c'){
+        while(i<5){    
+            led=1;
+            wait(1.5);
+            i++;
+        }    
+    }
+}   
+
+
+int main(){
+    device.baud(9600);
+    device.attach(getC,Serial::RxIrq);
+    while(1){
+    }
+}  
+ 
\ No newline at end of file
diff -r 000000000000 -r 0881a71b392b mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Jan 13 06:56:27 2022 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/e95d10626187
\ No newline at end of file