Skip to content

Commit

Permalink
Merge branch 'master' into CRC
Browse files Browse the repository at this point in the history
Signed-off-by: Sara Damiano <sdamiano@stroudcenter.org>
  • Loading branch information
SRGDamia1 committed Aug 14, 2024
2 parents e8528d8 + e93b4c6 commit 6b136ee
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ int state = 0;
#define WAIT 0
#define INITIATE_CONCURRENT 1
#define INITIATE_MEASUREMENT 2
#define PROCESS_COMMAND 3

// Create object by which to communicate with the SDI-12 bus on SDIPIN
SDI12 slaveSDI12(dataPin);
Expand Down Expand Up @@ -195,6 +196,7 @@ void loop() {
// Character '!' indicates the end of an SDI-12 command; if the current
// character is '!', stop listening and respond to the command
if (charReceived == '!') {
state = PROCESS_COMMAND;
// Command string is completed; do something with it
parseSdi12Cmd(commandReceived, dValues);
// Clear command string to reset for next command
Expand Down Expand Up @@ -246,5 +248,9 @@ void loop() {
slaveSDI12.forceListen(); // sets SDI-12 pin as input to prepare for incoming
// message AGAIN
break;
case PROCESS_COMMAND:
state = WAIT;
slaveSDI12.forceListen();
break;
}
}

0 comments on commit 6b136ee

Please sign in to comment.