Skip to content

Commit f50851d

Browse files
author
JLJu
committed
.ino small mod
1 parent c0df189 commit f50851d

1 file changed

Lines changed: 23 additions & 30 deletions

File tree

Software/Microcontroller/Firmware/AsgardADC/AsgardADC.ino

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1001,49 +1001,42 @@ endread:
10011001
// --------------------------------------------------
10021002
if (!strcmp(command, "$CCS"))
10031003
{
1004+
float SensorID, CalibMode;
10041005
if (strlen(command) < 1) goto endeval;
10051006
command = strtok (NULL, SEPARATOR); // Required command
1006-
if (!strcmp(command, "EXE")){ //Execute calibration command
1007-
command = strtok (NULL, SEPARATOR);
1008-
if (command != NULL) {
1009-
float SensorID_COM = (atof(command)); // Read the Sensor ID value
1007+
if (!strcmp(command, "EXE")) { //Execute calibration command
10101008
command = strtok (NULL, SEPARATOR);
10111009
if (command != NULL) {
1012-
float CalibMode_COM = (atof(command)); // Read required calibration mode
1010+
SensorID = (atof(command)); // Read the Sensor ID value
1011+
command = strtok (NULL, SEPARATOR);
1012+
if (command != NULL) {
1013+
CalibMode = (atof(command)); // Read required calibration mode
1014+
}
10131015
}
10141016
}
1015-
}
1016-
1017-
//strcpy (Answer, "$DFA,");
1018-
//char f1[20], f2[20], f3[20];
1019-
//sprintf(f1, "%.3f", sendtoserial_freq);
1020-
//strcat (Answer, f1);
1021-
//strcat (Answer, SEPARATOR);
1022-
//sprintf(f2, "%.3f", sendtobluetooth_freq);
1023-
//strcat (Answer, f2);
1024-
//strcat (Answer, SEPARATOR);
1025-
//sprintf(f3, "%.3f", sendtosd_freq);
1026-
//strcat (Answer, f3);
1027-
// strcpy (Answer,"$CCA,");
1028-
// strcat (Answer,"1"); // Send out sensor ID. Sensor ID numnber?
1029-
// strcat (Answer,SEPARATOR);
1030-
// strcat (Answer,"12"); //Integer offset
1031-
goto endeval;
1032-
}
1017+
strcpy (Answer, "$CCA,");
1018+
char f1[20], f2[20], f3[20];
1019+
sprintf(f1, "%.3f", SensorID);
1020+
strcat (Answer, f1);
1021+
strcat (Answer, SEPARATOR);
1022+
sprintf(f2, "%.3f", CalibMode);
1023+
strcat (Answer, f2);
1024+
goto endeval;
1025+
}
10331026

10341027
endeval:
10351028

10361029

1037-
// 3) In case answers to the right applicant
1030+
// 3) In case answers to the right applicant
10381031

1039-
if (strcmp(Answer, "")) {
1040-
if (endmsg_COM) Serial.println(Answer);
1041-
if (endmsg_BT) Serial1.println(Answer);
1042-
}
1032+
if (strcmp(Answer, "")) {
1033+
if (endmsg_COM) Serial.println(Answer);
1034+
if (endmsg_BT) Serial1.println(Answer);
10431035
}
1044-
1045-
delayMicroseconds(delaymicroseconds_interval); //delay
10461036
}
10471037

1038+
delayMicroseconds(delaymicroseconds_interval); //delay
1039+
}
1040+
10481041

10491042

0 commit comments

Comments
 (0)