#include "ThrottleQuadrant.hpp" namespace { //! The time point (in milliseconds since boot) when we last read out the data of the throttle quadrant. auto lastReadTimePoint = 0ul; } void setup() { Serial.begin(115200); ThrottleQuadrant.begin(2, 3, 4); } void loop() { auto currentTimePoint = millis(); // Read out the throttle quadrant if the minimum amount of wait time has passed. if ((currentTimePoint - lastReadTimePoint) >= ThrottleQuadrant.readDelayMillis) { auto data = ThrottleQuadrant.read(); lastReadTimePoint = millis(); Serial.write(reinterpret_cast(&data), sizeof(data)); } }