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
main.cpp@1:1e64adaf93da, 2015-02-19 (annotated)
- Committer:
- rrbeauch
- Date:
- Thu Feb 19 15:36:28 2015 +0000
- Revision:
- 1:1e64adaf93da
- Parent:
- 0:b638c214ca06
- Child:
- 2:44a3c2680cbf
1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rrbeauch | 0:b638c214ca06 | 1 | #include "mbed.h" |
rrbeauch | 0:b638c214ca06 | 2 | //-------------------------------------------------------------- |
rrbeauch | 0:b638c214ca06 | 3 | //CAN monitoring program for watching NXP LCP11C24 CAN messages |
rrbeauch | 0:b638c214ca06 | 4 | //Outputs to serial interface (Putty) |
rrbeauch | 0:b638c214ca06 | 5 | //02/19/2015 |
rrbeauch | 0:b638c214ca06 | 6 | //-------------------------------------------------------------- |
rrbeauch | 0:b638c214ca06 | 7 | CAN can(p9, p10); |
rrbeauch | 0:b638c214ca06 | 8 | |
rrbeauch | 0:b638c214ca06 | 9 | int main() { |
rrbeauch | 0:b638c214ca06 | 10 | int messagecount = 0; |
rrbeauch | 0:b638c214ca06 | 11 | printf("CAN Listener\n"); |
rrbeauch | 0:b638c214ca06 | 12 | CANMessage msg; |
rrbeauch | 0:b638c214ca06 | 13 | while(1) { |
rrbeauch | 0:b638c214ca06 | 14 | if(can.read(msg)) { |
rrbeauch | 0:b638c214ca06 | 15 | printf("%d ----- Message received: %d\n", messagecount, msg.data[0]); |
rrbeauch | 0:b638c214ca06 | 16 | messagecount++; |
rrbeauch | 1:1e64adaf93da | 17 | } |
rrbeauch | 0:b638c214ca06 | 18 | } |
rrbeauch | 0:b638c214ca06 | 19 | } |