This tests the CAN interface between two LISA C027 MBED Boards. By connecting the two boards, pins 1,2,3 respectively on the CAN interface, and loading and executing this code on BOTH boards, CAN messages will be received, and printed, on the PC-USB console interface of both devices.

Dependencies:   C027-REVB UbloxUSBModem mbed

Fork of C027_ModemTransparentUSBCDC_revb by Stephen Dickey

Files at this revision

API Documentation at this revision

Comitter:
dixter1
Date:
Sun Dec 15 21:35:12 2013 +0000
Parent:
2:c4ad86683060
Commit message:
Comment update and C027-REVB Library Update.

Changed in this revision

C027-REVB.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r c4ad86683060 -r 048ec5c2dc14 C027-REVB.lib
--- a/C027-REVB.lib	Sat Dec 14 00:24:59 2013 +0000
+++ b/C027-REVB.lib	Sun Dec 15 21:35:12 2013 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/dixter1/code/C027-REVB/#db7c445289f5
+http://mbed.org/users/dixter1/code/C027-REVB/#2ab87e985526
diff -r c4ad86683060 -r 048ec5c2dc14 main.cpp
--- a/main.cpp	Sat Dec 14 00:24:59 2013 +0000
+++ b/main.cpp	Sun Dec 15 21:35:12 2013 +0000
@@ -9,6 +9,8 @@
 
 char counter = 0;
 
+// this function creates a CAN message with a counter in it
+//   and sends it on the CAN interface
 void send() {
     if(can1.write(CANMessage(1337, &counter, 1))) {
         pc.printf("Message sent: %d\r\n", counter);
@@ -25,6 +27,8 @@
     //   take it out of standby
     can_standby = 0;
     
+    // specify the baud rate for communications
+    //   with the serial console to the PC host.
     pc.baud(MDMBAUD);
     
     pc.printf( "Starting CAN Testing\r\n");
@@ -39,6 +43,7 @@
         
         wait(0.2);
         
+        // send a new message.
         send();
     }
 }