dror balbul
/
CANrecive
can reciving for noam
Revision 0:d6eafce8e991, committed 2019-12-27
- 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 |
--- /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
--- /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