Skip to content

Arduino library for providing a convenient C++ interface for accessing UAVCAN.

License

Notifications You must be signed in to change notification settings

rotoye/107-Arduino-UAVCAN

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

107-Arduino-UAVCAN

Unit Tests codecov Compile Examples Arduino Lint keywords.txt Checks General Formatting Checks Spell Check

Arduino library for providing a convenient C++ interface for accessing UAVCAN (v1.0-beta) utilizing libcanard.

This library works for

Reference-Implementation UAVCAN on Arduino

Example

#include <ArduinoUAVCAN.h>
/* ... */
ArduinoUAVCAN uavcan(13, transmitCanFrame);
Heartbeat_1_0 hb;
/* ... */
void loop() {
  /* Update the heartbeat object */
  hb.uptime(millis() / 1000);
  hb.mode = Heartbeat_1_0::Mode::OPERATIONAL;

  /* Publish the heartbeat once/second */
  static unsigned long prev = 0;
  unsigned long const now = millis();
  if(now - prev > 1000) {
    uavcan.publish(hb);
    prev = now;
  }

  /* Transmit all enqeued CAN frames */
  while(uavcan.transmitCanFrame()) { }
}
/* ... */
bool transmitCanFrame(CanardFrame const & frame) {
  /* ... */
}

Contribution

Please take a look at the wiki for notes pertaining development of 107-Arduino-UAVCAN.

About

Arduino library for providing a convenient C++ interface for accessing UAVCAN.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 92.9%
  • C++ 7.1%