mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-07-06 02:24:30 +02:00
add fernbedienung example
This commit is contained in:
25
example/Fernbedienung/empfaenger/empfaenger.ino
Normal file
25
example/Fernbedienung/empfaenger/empfaenger.ino
Normal file
@ -0,0 +1,25 @@
|
||||
#include "Dezibot.h"
|
||||
|
||||
|
||||
Dezibot dezibot = Dezibot();
|
||||
|
||||
void receivedCallback(String &msg) {
|
||||
if (msg == "vorn") {
|
||||
dezibot.motion.move();
|
||||
} else if (msg == "links") {
|
||||
dezibot.motion.rotateAntiClockwise();
|
||||
} else if (msg == "rechts") {
|
||||
dezibot.motion.rotateClockwise();
|
||||
} else if (msg == "stop") {
|
||||
dezibot.motion.stop();
|
||||
}
|
||||
}
|
||||
void setup() {
|
||||
dezibot.begin();
|
||||
dezibot.communication.begin();
|
||||
dezibot.communication.setGroupNumber(5);
|
||||
dezibot.communication.onReceive(&receivedCallback);
|
||||
}
|
||||
|
||||
void loop() {
|
||||
}
|
Reference in New Issue
Block a user