Skip to content
This repository has been archived by the owner on May 26, 2024. It is now read-only.

Arduino library for providing boost::units for the Arduino platform.

License

Notifications You must be signed in to change notification settings

107-systems/107-Arduino-BoostUnits

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

107-Arduino-BoostUnits

Arduino Library Badge Compile Examples Arduino Lint keywords.txt Checks General Formatting Checks Spell Check

Arduino library for providing boost::units for the Arduino platform.

This library works for

Example

#include "Arduino-BoostUnits.h"
using namespace drone::unit;

#define DBG_ENABLE_INFO
#include <107-Arduino-Debug.hpp>
/* ... */
DEBUG_INSTANCE(80, Serial);
/* ... */
void setup()
{
  Serial.begin(9600);
  while (!Serial) { }

  Length const l1 = 2.0 * meters;
  Length const l2 = 4.0 * meters;
  Time   const t  = 0.5 * seconds;
  DBG_INFO("l1 = %.2f, b = %.2f, t = %.2f", l1.value(), l2.value(), t.value());

  Length const l3 = (l1 + l2);
  DBG_INFO("l1 + l2 = %.2f", l3.value());

  Area const area = l1 * l2;
  DBG_INFO("l1 * l2 = %.2f", area.value());

  Velocity const velocity = l1 / t;
  DBG_INFO("l1 / t = %.2f", velocity.value());

  Acceleration const acceleration = velocity / t;
  DBG_INFO("velocity / t = %.2f", acceleration.value());
}

void loop()
{

}

About

Arduino library for providing boost::units for the Arduino platform.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages