Update main.c

pull/13/head
alanbjohnston 7 years ago committed by GitHub
parent bc9d9125e8
commit ad35fdedba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -119,7 +119,7 @@ struct SensorData read_sensor_data(struct SensorConfig sensor) {
// float valuec3 = (float)(twos);
delay(50);
wiringPiI2CWrite(sensor.fd, INA219_REG_CURRENT);
delay(1); // Max 12-bit conversion time is 586us per sample
delay(50); // Max 12-bit conversion time is 586us per sample
int valueC = ((wiringPiI2CRead(sensor.fd) << 8 ) | wiringPiI2CRead (sensor.fd));
int twos = twosToInt(valueC, 16);
float valuec3 = (float)(twos);

Loading…
Cancel
Save

Powered by TurnKey Linux.