MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / setSinglePointCorrection

Method setSinglePointCorrection

libraries/MTP40C/MTP40C.cpp:158–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156
157
158bool MTP40::setSinglePointCorrection(float spc)
159{
160 if ((spc < 400) || (spc > 5000)) return false;
161
162 union
163 {
164 float value;
165 uint8_t b[4];
166 } convert;
167
168 uint8_t cmd[9] = { 0xFE, 0x28, 0x80, 0x00, 0x80, 0x40, 0x44, 0x33, 0x22 };
169 convert.value = spc;
170 for (uint8_t i = 0; i < 4; i++)
171 {
172 cmd[3 + i] = convert.b[i];
173 }
174 if (request(cmd, 9, 10) )
175 {
176 if (_buffer[7] ) return true;
177 }
178 return false;
179}
180
181
182bool MTP40::getSinglePointCorrectionReady()

Callers 1

unittestFunction · 0.80

Calls

no outgoing calls

Tested by 1

unittestFunction · 0.64