can reciving for noam

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
drorbalbul
Date:
Fri Dec 27 17:50:14 2019 +0000
Commit message:
canrec for noam

Changed in this revision

mbed.bld Show annotated file Show diff for this revision Revisions of this file
recive.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r d6eafce8e991 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Dec 27 17:50:14 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file
diff -r 000000000000 -r d6eafce8e991 recive.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/recive.cpp	Fri Dec 27 17:50:14 2019 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+
+DigitalOut led1(LED1);
+CAN can1(PA_11, PA_12);
+
+int main() {
+    printf("main()\n");
+    CANMessage msg;
+    while(1) {
+        if(can1.read(msg)) {
+            printf("got it\n\r");
+            printf("Message received: %d,,\n\r", msg.data[0]);
+            led1 = !led1;
+        } 
+        wait(0.2);
+    }
+}
\ No newline at end of file