Dezibot 4
Loading...
Searching...
No Matches
sender.ino
Go to the documentation of this file.
1#include "Dezibot.h"
2
3
4Dezibot dezibot = Dezibot();
5
6void setup() {
7 dezibot.begin();
8 dezibot.communication.begin();
9 dezibot.communication.setGroupNumber(5);
10}
11
12void loop() {
13 switch (dezibot.motion.detection.getTiltDirection()) {
14 case Front:
15 dezibot.multiColorLight.setTopLeds(GREEN);
16 dezibot.communication.sendMessage("vorn");
17 break;
18 case Left:
19 dezibot.multiColorLight.setTopLeds(YELLOW);
20 dezibot.communication.sendMessage("links");
21 break;
22 case Right:
23 dezibot.multiColorLight.setTopLeds(TURQUOISE);
24 dezibot.communication.sendMessage("rechts");
25 break;
26 case Back:
27 dezibot.multiColorLight.setTopLeds(BLUE);
28 dezibot.communication.sendMessage("stop");
29 break;
30 case Flipped:
31 dezibot.multiColorLight.setTopLeds(PINK);
32 dezibot.communication.sendMessage("stop");
33 break;
34 case Neutral:
35 dezibot.multiColorLight.turnOffLed();
36 dezibot.communication.sendMessage("stop");
37 break;
38
39 case Error:
40 dezibot.multiColorLight.setTopLeds(RED);
41 dezibot.communication.sendMessage("stop");
42 break;
43 }
44
45 delay(100);
46}