added sleep(1) before reading current sensor

pull/33/merge
alanbjohnston 6 years ago committed by GitHub
parent 7337eb3bdf
commit 61db1dd919
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -166,6 +166,7 @@ struct SensorData read_sensor_data(struct SensorConfig sensor) {
wiringPiI2CWriteReg16(sensor.fd, INA219_REG_CALIBRATION, sensor.calValue);
wiringPiI2CWriteReg16(sensor.fd, INA219_REG_CONFIG, sensor.config);
wiringPiI2CWriteReg16(sensor.fd, INA219_REG_CALIBRATION, sensor.calValue);
sleep(1);
int value = wiringPiI2CReadReg16(sensor.fd, INA219_REG_CURRENT);
if (value == -1)
{

Loading…
Cancel
Save

Powered by TurnKey Linux.