Update telem.c

pull/55/head
alanbjohnston 5 years ago committed by GitHub
parent c8ed3787aa
commit a98f71abcf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -332,15 +332,7 @@ int main(int argc, char *argv[]) {
FILE* file = popen("python3 /home/pi/CubeSatSim/python/voltcurrent.py 1 3 c", "r");
pclose(file);
char cmdbuffer[1000];
fgets(cmdbuffer, 1000, file);
printf("result: %s\n", cmdbuffer);
pclose(file);
// data.voltage = atof(cmdbuffer);
int count;
// for (count = 0; count < 8; count++)
{
file = popen("python3 /home/pi/CubeSatSim/python/voltcurrent.py 1 3 c", "r");
// char cmdbuffer[1000];
@ -350,12 +342,14 @@ int main(int argc, char *argv[]) {
char *token;
const char space[2] = " ";
for (count = 0; count < 8; count++)
{
token = strtok(cmdbuffer, space);
printf("token: %s\n", token);
printf("voltage: %s ", token);
token = strtok(NULL, space);
printf("token: %s\n", token);
token = strtok(NULL, space);
printf("token: %s\n", token);
printf("current: %s\n", token);
}

Loading…
Cancel
Save

Powered by TurnKey Linux.