#include class MockScale { public: MockScale( uint16_t valueMin=0, uint16_t valueMax=10) : valueMin_(valueMin), valueMax_(valueMax), currentValue_(valueMin), direction(1) {} bool measure(uint16_t & measurementOut) { currentValue_ += direction; if ( currentValue_ >= valueMax_) { direction = -1; valueMax_ += 2; } else if ( currentValue_ <= valueMin_ ) direction = +1; measurementOut = currentValue_; return true; } void begin(uint32_t , uint32_t ) { }; void tare(uint32_t ) { } private: uint16_t valueMin_; uint16_t valueMax_; uint16_t currentValue_; int direction; };