add Arduino example

This commit is contained in:
2023-07-30 11:10:19 +03:00
parent 82e034fdd0
commit 3ff907994a
5 changed files with 31 additions and 1 deletions
+1 -1
View File
@@ -2,5 +2,5 @@
indent_style = space
indent_size = 4
[*.c]
[{*.c,*.ino}]
indent_size = 2
+1
View File
@@ -0,0 +1 @@
3party/
+24
View File
@@ -0,0 +1,24 @@
/*
Author: Alexander Popov
License: Unlicense
*/
#include "3party/AsyncStream.h"
AsyncStream<50> serial(&Serial, '\n');
void setup() {
Serial.begin(9600);
}
void loop() {
if (strcmp(serial.buf, "ping") == 0) {
Serial.println("PONG");
}
Serial.println("ooooo");
// delay(1000);
Serial.println("zzzz");
// delay(1000);
Serial.println("xxx");
// delay(1000);
}
+3
View File
@@ -0,0 +1,3 @@
Download `AsyncStream.h` from
https://github.com/GyverLibs/AsyncStream
and drop in to `3party` folder.
+2
View File
@@ -14,3 +14,5 @@ export LIBRARY_PATH=<path/to/libserialport/.libs>
gcc -static -Wall -O3 -o <output_filename> <file.c> -lserialport
```
Arduino example project store in `Board` folder.