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

@ -207,12 +207,12 @@ int main(int argc, char *argv[]) {
printf("Bus | sensor[%d] % 4.2fV % 6.1fmA % 6.1fmW \n",
BUS, readingV.voltage, readingV.current, readingV.power);
tempSensor = config_sensor("/dev/i2c-3", 0x48, 0);
sensorV = config_sensor("/dev/i2c-3", 0x48, 0);
sensorV = config_sensor("/dev/i2c-1", 0x45, 400);
if (sensorV.fd != OFF) {
int tempValue = wiringPiI2CReadReg16(SensorV.fd, 0);
int tempValue = wiringPiI2CReadReg16(sensorV.fd, 0);
uint8_t upper = (uint8_t) (tempValue >> 8);
uint8_t lower = (uint8_t) (tempValue & 0xff);
float temp = (float)lower + ((float)upper / 0x100);

Loading…
Cancel
Save

Powered by TurnKey Linux.