arduino serial example
This commit is contained in:
parent
5538558c7c
commit
836a237ec7
14
snipplets/code/Arduino/serial.ino
Normal file
14
snipplets/code/Arduino/serial.ino
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
// будем искать слово hello
|
||||||
|
char target[] = "hello";
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
Serial.begin(9600);
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
if (Serial.available() > 0) {
|
||||||
|
if (Serial.find(target))
|
||||||
|
Serial.println("found");
|
||||||
|
// вывести found, если было послано hello
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user