Revision 8e095f02 examples/restore_offsets/restore_offsets.ino
examples/restore_offsets/restore_offsets.ino | ||
---|---|---|
177 | 177 |
bno.getSensor(&sensor); |
178 | 178 |
if (bnoID != sensor.sensor_id) |
179 | 179 |
{ |
180 |
Serial.println("No Calibration Data for this sensor exists in EEPROM"); |
|
180 |
Serial.println("\nNo Calibration Data for this sensor exists in EEPROM");
|
|
181 | 181 |
} |
182 | 182 |
else |
183 | 183 |
{ |
184 |
Serial.println("Found Calibration for this sensor in EEPROM."); |
|
184 |
Serial.println("\nFound Calibration for this sensor in EEPROM.");
|
|
185 | 185 |
eeAddress += sizeof(long); |
186 | 186 |
EEPROM.get(eeAddress, calibrationData); |
187 | 187 |
|
... | ... | |
241 | 241 |
Serial.println("\nFully calibrated!"); |
242 | 242 |
Serial.println("--------------------------------"); |
243 | 243 |
Serial.println("Calibration Results: "); |
244 |
bno.getSensorOffsets(calibrationData); |
|
245 |
displaySensorOffsets(calibrationData); |
|
244 |
adafruit_bno055_offsets_t newCalib; |
|
245 |
bno.getSensorOffsets(newCalib); |
|
246 |
displaySensorOffsets(newCalib); |
|
246 | 247 |
|
247 | 248 |
Serial.println("\n\nStoring calibration data to EEPROM..."); |
248 | 249 |
|
... | ... | |
253 | 254 |
EEPROM.put(eeAddress, bnoID); |
254 | 255 |
|
255 | 256 |
eeAddress += sizeof(long); |
256 |
EEPROM.put(eeAddress, calibrationData);
|
|
257 |
Serial.println("Data stored to EEPROM.\n");
|
|
257 |
EEPROM.put(eeAddress, newCalib);
|
|
258 |
Serial.println("Data stored to EEPROM."); |
|
258 | 259 |
|
259 | 260 |
Serial.println("\n--------------------------------\n"); |
261 |
delay(500); |
|
260 | 262 |
} |
261 | 263 |
|
262 | 264 |
void loop() { |
Also available in: Unified diff