1
0
mirror of https://github.com/AlexGyver/GyverCore.git synced 2025-04-19 08:42:16 +03:00
GyverCore/examples/parseTest/parseTest.ino
2019-08-02 19:08:10 +03:00

22 lines
516 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// пример работы с функцией uartParsePacket
// функция принимает из порта строку вида
// $10 21 458 63 8 45 875 215;
// и запихивает в массив dataArray
int dataArray[8];
void setup() {
uartBegin(); // открыть на 9600
}
void loop() {
// $10 21 458 63 8 45 875 215;
if (uartParsePacket((int*)dataArray)) {
for (byte i = 0; i < 8; i++) {
uartPrint(dataArray[i]);
uartPrint(" ");
}
uartPrintln();
}
}