![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
I am no longer actively working on the ppCANOpen library, however, I want to publish this project so that anyone who wants to pick up any of the pieces can have a good example. This is a a project I was working on using the ppCANOpen library. It has a pretty in deep use of the object dictionary structure. And a number of functions to control high voltage pinball drivers, if you're into that sort of thing.
Dependencies: CANnucleo mbed ppCANOpen
Diff: Application/source/main.cpp
- Revision:
- 10:ec59d628ebdc
diff -r 8352cfe17ab1 -r ec59d628ebdc Application/source/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Application/source/main.cpp Sat Mar 19 01:44:35 2016 +0000 @@ -0,0 +1,71 @@ + +/** @file + * @brief main program entry + */ + +#include "mbed.h" +#include "CAN.h" + +#include "ppCANOpen.h" +#include "Node_pin0808.h" + +DigitalOut boardLed (LED1); + +void InputScan () +{ + boardLed = !boardLed; +} + + +int main() +{ + + printf ("\r\n----- MAIN -----\r\n"); + + /* blinker task*/ + boardLed = 0; + +//#define MASTER +#ifdef MASTER + + /* CanOpen start */ + ServiceProvider service; + printf ("----- READY -----\r\n"); + + Node_pin0808 node1(2, &service); + //Node_pin0808 node2(&service); + + service.PostNmtControl(1, NMT_CS_RESET_NODE); + service.Run(); + service.PostNmtControl(2, NMT_CS_START); + service.Run(); + service.PostNmtControl(3, NMT_CS_START); + service.Run(); + service.PostNmtControl(4, NMT_CS_START); + service.Run(); + service.PostNmtControl(5, NMT_CS_START); + service.Run(); + service.PostNmtControl(6, NMT_CS_START); + service.Run(); + + while (1) { + service.Run(); + } + +#else + + /* CanOpen start */ + ServiceProvider service; + printf ("----- READY -----\r\n"); + + Node_pin0808 node1(3, &service); + + while (1) { + service.Run(); + } + +#endif + + printf ("----- END -------\r\n\n"); + +}