Hardware Braille Simulator / Mbed 2 deprecated CAN_SENDER

Dependencies:   mbed

Fork of CAN_SENDER by Aasheesh Francis

main.cpp

Committer:
rrbeauch
Date:
2015-02-19
Revision:
0:b638c214ca06
Child:
1:1e64adaf93da

File content as of revision 0:b638c214ca06:

#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; 
    }
}