Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Fork of CAN_SENDER by
Diff: main.cpp
- Revision:
- 0:b638c214ca06
- Child:
- 1:1e64adaf93da
diff -r 000000000000 -r b638c214ca06 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Feb 19 15:34:54 2015 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +//-------------------------------------------------------------- +//CAN monitoring program for watching NXP LCP11C24 CAN messages +//Outputs to serial interface (Putty) +//02/19/2015 +//-------------------------------------------------------------- +CAN can(p9, p10); +DigitalOut led(LED1); + +int main() { + int messagecount = 0; + printf("CAN Listener\n"); + CANMessage msg; + while(1) { + if(can.read(msg)) { + printf("%d ----- Message received: %d\n", messagecount, msg.data[0]); + messagecount++; + led = 1; + wait(0.2); + } + led = 0; + } +} \ No newline at end of file