From 1ee0ee87a75f04a71b86a301c06e7c311464d546 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 2 Mar 2022 08:11:45 -0500 Subject: [PATCH] removed board version check was interfering with Blue Tx LED --- telem.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/telem.c b/telem.c index eff6ba50..4f2c158d 100644 --- a/telem.c +++ b/telem.c @@ -14,6 +14,9 @@ int main(int argc, char *argv[]) { debug = ON; } } + +/* + wiringPiSetup (); printf("\n"); @@ -40,7 +43,7 @@ int main(int argc, char *argv[]) { printf("vB4 Present\n"); map[BAT] = BUS; map[BUS] = BAT; - snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); + snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(0)); // strcpy(busStr,"1 0"); } else @@ -68,6 +71,15 @@ int main(int argc, char *argv[]) { } } } +*/ + + printf("CubeSatSim v1.1 INA219 Voltage and Current Telemetry\n"); + map[MINUS_X] = MINUS_Y; + map[PLUS_Z] = MINUS_X; + map[MINUS_Y] = PLUS_Z; + snprintf(busStr, 10, "%d %d", test_i2c_bus(1), test_i2c_bus(3)); + + // Reading I2C voltage and current sensors // printf("Starting\n"); @@ -127,7 +139,8 @@ int main(int argc, char *argv[]) { printf("-Y | % 4.2f V % 5.0f mA \n", voltage[map[MINUS_Y]], current[map[MINUS_Y]]); printf("-Z | % 4.2f V % 5.0f mA \n", voltage[map[MINUS_Z]], current[map[MINUS_Z]]); printf("Bat | % 4.2f V % 5.0f mA \n", voltage[map[BAT]], current[map[BAT]]); - printf("Bus | % 4.2f V % 5.0f mA \n\n", voltage[map[BUS]], current[map[BUS]]); + printf("Bus | % 4.2f V % 5.0f mA \n\n", voltage[map[BUS]], current[map[BUS]]); + fclose(file1); return 0; } @@ -141,7 +154,7 @@ int test_i2c_bus(int bus) strcat (busDev, busS); // printf("Bus Dev String: %s \n", busDev); - if (access(busDev, W_OK | R_OK) >= 0) { // Test if I2C Bus is present + if (access(busDev, W_OK | R_OK) >= 0) { // Test if I2C Bus is present // printf("bus is present\n\n"); char result[128]; const char command_start[] = "timeout 10 i2cdetect -y "; @@ -161,7 +174,7 @@ int test_i2c_bus(int bus) { printf("ERROR: %d bus has a problem \n Check I2C wiring and pullup resistors \n", bus); output = -1; - } + } } else { printf("ERROR: %d bus has a problem \n Check software to see if enabled \n", bus);