Each LPC1768 is capable of controlling 2 CAN bus lines. Linking multiple chips together via SPI allows for more bus lines to be monitored simultaneously. Master unit.
Diff: main.cpp
- Revision:
- 0:855b6e84e744
diff -r 000000000000 -r 855b6e84e744 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Fri Oct 31 22:13:47 2014 +0000 @@ -0,0 +1,26 @@ +#include "mbed.h" +#include "spiMasterProtocol.h" + +// https://developer.mbed.org/forum/helloworld/topic/2541/ + +Serial pc(USBTX, USBRX); // tx, rx + +int main() { + spiMasterProtocol* canDevice = new spiMasterProtocol(); + + pc.printf("======================================================\r\n"); + pc.printf("Press any key to start...\r\n"); + pc.getc(); // wait for keyboard + + while (1) { + + canDevice->get42(); + + wait(0.5); // Wait for 5 seconds for readability only + + canDevice->get84(); + + wait(0.5); + + } +} \ No newline at end of file