From b1cd28662e5e8f5c434a22531da4a15aede2c8bc Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Sat, 8 Aug 2020 16:40:35 -0400 Subject: [PATCH] Update telem.c --- afsk/telem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/afsk/telem.c b/afsk/telem.c index 2d071781..dc059804 100644 --- a/afsk/telem.c +++ b/afsk/telem.c @@ -126,7 +126,9 @@ struct SensorData read_sensor_data(struct SensorConfig sensor) { struct SensorConfig config_sensor(char *bus, int address, int milliAmps) { struct SensorConfig data; - printf("Bus lencth %d \n", atoi(bus[(strlen(bus)/sizeof(bus[0])) - 1])); + int pos = strlen(bus) / sizeof(bus[0]) - 1; + printf("Bus size %d \n", pos); + printf("Bus value %d \n", atoi(*bus[pos])); FILE *i2cdetect = popen("timeout --preserve-status 5 i2cdetect -y 0", "r"); // printf("1\n");