Skip to content

Instantly share code, notes, and snippets.

@kkmonster
Last active June 23, 2020 15:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkmonster/fc1662fa746b9d262b81c7a3ce18d989 to your computer and use it in GitHub Desktop.
Save kkmonster/fc1662fa746b9d262b81c7a3ce18d989 to your computer and use it in GitHub Desktop.
void recv()
{
while (Serial3.available() > 0)
{
for (byte index = 0; index < MAXLENGTH - 1; index++)
{
receivedCommandStack[index] = receivedCommandStack[index + 1];
}
receivedCommandStack[MAXLENGTH - 1] = Serial3.read();
if ((receivedCommandStack[0] == 0xFF) && (receivedCommandStack[1] == 0x17) && (receivedCommandStack[2] == 0x00) && (receivedCommandStack[3] == 0x00)) //head bit and sum are all right
{
uint8_t vPin = receivedCommandStack[4];
uint8_t value = receivedCommandStack[5];
Blynk.virtualWrite(vPin, value);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment