Currently supported platforms:
static constexpr uint8_t MyNodeId = 1;
static float temperatureC = 0.f;
static canfetti::TyCoDev canDevice;
static canfetti::TyCo co(canDevice, MyNodeId, "MyNodeName");
void setup()
{
tempmon_init();
co.init();
co.setHeartbeatPeriod(1000); // Send a NMT heartbeat @ 1Hz
// TPDO1 @ 10Hz
co.autoAddTPDO(1, 0x181, 100, canfetti::_p(temperatureC));
}
void loop() {
co.service(); // Runs the CANopen stack
...
temperatureC = tempmonGetTemp();
...
}