Browse Source

Add the example for the fliprobot.

Wesley Tsai 8 years ago
parent
commit
6c6a74cd79
1 changed files with 30 additions and 0 deletions
  1. 30 0
      examples/Brickup_fliprobot/Brickup_fliprobot.ino

+ 30 - 0
examples/Brickup_fliprobot/Brickup_fliprobot.ino

@@ -0,0 +1,30 @@
1
+#include <I2CRobot.h>
2
+
3
+int I2C_ID = 8;
4
+I2CRobot fliprobot(I2C_ID);
5
+
6
+void setup() {
7
+  fliprobot.init();
8
+}
9
+
10
+void loop() {
11
+    byte robot_control = '1';
12
+    if (robot_control != -1) {
13
+        switch(robot_control) {
14
+          case '1':
15
+            fliprobot.hello();
16
+            break;
17
+          case '2': 
18
+            fliprobot.order();
19
+            break;
20
+          case '3':
21
+            fliprobot.check();
22
+            break;
23
+          case '4':
24
+            fliprobot.custom(4);
25
+            break;
26
+          default:
27
+            break;
28
+        }
29
+    }
30
+}