Hardware Braille Simulator / Mbed 2 deprecated CAN_SENDER

Dependencies:   mbed

Fork of CAN_SENDER by Aasheesh Francis

Committer:
rrbeauch
Date:
Thu Feb 19 15:34:54 2015 +0000
Revision:
0:b638c214ca06
Child:
1:1e64adaf93da
CAN Listener Program

Who changed what in which revision?

UserRevisionLine numberNew 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 DigitalOut led(LED1);
rrbeauch 0:b638c214ca06 9
rrbeauch 0:b638c214ca06 10 int main() {
rrbeauch 0:b638c214ca06 11 int messagecount = 0;
rrbeauch 0:b638c214ca06 12 printf("CAN Listener\n");
rrbeauch 0:b638c214ca06 13 CANMessage msg;
rrbeauch 0:b638c214ca06 14 while(1) {
rrbeauch 0:b638c214ca06 15 if(can.read(msg)) {
rrbeauch 0:b638c214ca06 16 printf("%d ----- Message received: %d\n", messagecount, msg.data[0]);
rrbeauch 0:b638c214ca06 17 messagecount++;
rrbeauch 0:b638c214ca06 18 led = 1;
rrbeauch 0:b638c214ca06 19 wait(0.2);
rrbeauch 0:b638c214ca06 20 }
rrbeauch 0:b638c214ca06 21 led = 0;
rrbeauch 0:b638c214ca06 22 }
rrbeauch 0:b638c214ca06 23 }