215 uint8_t checksum = 0;
221 for (
unsigned int i = 0; i < str.length(); i++)
224 sprintf(
ck,
"%x", checksum);
Driver for the VN100S IMU.
ReturnsStates
Structure of the errors in the ASCII requests.
LoadCellModes
Enumeration of all the modes supported by the driver.
LoadCellValuesEnum
Enumeration of all the requests in ASCII mode.
std::map< const LoadCellValuesEnum, std::string > LoadCellValues
Type that maps the different requests to their keyword.
Structure that contains all the parameters for the request to be sent.
std::string to_string()
Transforms the request into a string to be sent over serial.
void setChecksum()
In base of the address and the request parameter calculates the checksum.
Structure of the output of the load cell in [continuous mode -> ModT].
Structure of the output of the load cell in [continuous mode -> ModTd].
Structure that stores a data value, with his timestamp and his validity.
MBLoadCellData(float data)
MBLoadCellData(uint64_t loadTimestamp, float data)
static constexpr auto reflect()
Structure of the output of the load cell in [continuous mode -> ModT].
void updateValue(LoadCellValuesEnum val, float data)
Updates the correct value with the data passed. Also, memorizes the maximum and minimum value of the ...
MBLoadCellData peakWeight
void print() const
Prints the structure in a nice way.