Skip to content

ntisserand/canfetti

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CANfetti

License: MIT

A CANopen stack by Scythe 🎊

Currently supported platforms:

Examples

Teensy Example

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();
  ...
}

About

A CANopen stack by Scythe

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 98.3%
  • CMake 1.7%