From fff2d3c75566d232d3ae27e4625ec27dbe045b6f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Fri, 17 Jan 2020 19:18:51 -0500 Subject: [PATCH] updated with I2C addresses for new vB4 PCB --- afsk/telem.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/afsk/telem.c b/afsk/telem.c index 6bc578e6..83ae2885 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -181,22 +181,22 @@ int main(int argc, char *argv[]) { printf("+Y | sensor[%d] % 4.2fV % 6.1fmA % 6.1fmW \n", PLUS_Y, readingV.voltage, readingV.current, readingV.power); - sensorV = config_sensor("/dev/i2c-1", 0x44, 400); + sensorV = config_sensor("/dev/i2c-0", 0x40, 400); readingV = read_sensor_data(sensorV); printf("+Z | sensor[%d] % 4.2fV % 6.1fmA % 6.1fmW \n", PLUS_Z, readingV.voltage, readingV.current, readingV.power); - sensorV = config_sensor("/dev/i2c-0", 0x40, 400); + sensorV = config_sensor("/dev/i2c-0", 0x41, 400); readingV = read_sensor_data(sensorV); printf("-X | sensor[%d] % 4.2fV % 6.1fmA % 6.1fmW \n", MINUS_X, readingV.voltage, readingV.current, readingV.power); - sensorV = config_sensor("/dev/i2c-0", 0x41, 400); + sensorV = config_sensor("/dev/i2c-0", 0x44, 400); readingV = read_sensor_data(sensorV); printf("-Y | sensor[%d] % 4.2fV % 6.1fmA % 6.1fmW \n", MINUS_Y, readingV.voltage, readingV.current, readingV.power); - sensorV = config_sensor("/dev/i2c-0", 0x44, 400); + sensorV = config_sensor("/dev/i2c-0", 0x45, 400); readingV = read_sensor_data(sensorV); printf("-Z | sensor[%d] % 4.2fV % 6.1fmA % 6.1fmW \n", MINUS_Z, readingV.voltage, readingV.current, readingV.power); @@ -207,11 +207,11 @@ int main(int argc, char *argv[]) { printf("Bat | sensor[%d] % 4.2fV % 6.1fmA % 6.1fmW \n", BAT, readingV.voltage, readingV.current, readingV.power); - sensorV = config_sensor("/dev/i2c-1", 0x4a, 2000); + sensorV = config_sensor("/dev/i2c-0", 0x44, 400); readingV = read_sensor_data(sensorV); printf("Bus | sensor[%d] % 4.2fV % 6.1fmA % 6.1fmW \n", BUS, readingV.voltage, readingV.current, readingV.power); - +/* sensorV = config_sensor("/dev/i2c-3", 0x48, 0); if (sensorV.fd != OFF) { int tempValue = wiringPiI2CReadReg16(sensorV.fd, 0); @@ -220,13 +220,13 @@ int main(int argc, char *argv[]) { float temp = (float)lower + ((float)upper / 0x100); printf("T | % 4.1f C \n", temp); } + */ printf("\n\n"); return 0; } - int twosToInt(int val,int len) { // Convert twos compliment to integer // from https://www.raspberrypi.org/forums/viewtopic.php?t=55815