Last active
June 23, 2020 15:14
-
-
Save kkmonster/fc1662fa746b9d262b81c7a3ce18d989 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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