changeset 48:dda48811342a

Add accelerometer support
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Thu, 21 Aug 2014 11:12:55 +0200
parents 16316a3f7549
children 6ec1356c03ae
files creep.py scad/arduino.scad servo/servo.ino
diffstat 3 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/creep.py	Mon Aug 18 19:11:28 2014 +0200
+++ b/creep.py	Thu Aug 21 11:12:55 2014 +0200
@@ -104,7 +104,7 @@
 
     FPS = 24
 
-    robot = kubik.Robot(serial.Serial('/dev/ttyUSB0', 115200))
+    robot = kubik.Robot(serial.Serial('/dev/rfcomm0', 9600))
     creep = Creep(robot)
     robot.run_animations([
         creep.stomp_anim(),
--- a/scad/arduino.scad	Mon Aug 18 19:11:28 2014 +0200
+++ b/scad/arduino.scad	Thu Aug 21 11:12:55 2014 +0200
@@ -24,13 +24,15 @@
             }
             color("DimGray") {
                 translate([8.9, 9.1, 0.5]) rotate(45) cube([7, 7, 1]);
+                translate([8.2, 22, 1]) cube([1.6, 3.8, 1]);
+            }
+            color("Orange") {
                 translate([12, 23, 1]) cube([2, 4, 1]);
                 translate([17.8 - 14, 23, 1]) cube([2, 4, 1]);
-                translate([8.2, 22, 1]) cube([1.6, 3.8, 1]);
             }
             translate([8.9, 3.5, 0.5]) {
                 rotate(22.5) color("Silver") cylinder(r=3, h=0.75, $fn=8);
-                rotate(22.5) color("LIghtGray") cylinder(r=2.5, h=1, $fn=8);
+                rotate(22.5) color("LightGray") cylinder(r=2.5, h=1, $fn=8);
                 color("Gold") cylinder(r=1.2, h=1.5, $fn=8);
             }
         }
--- a/servo/servo.ino	Mon Aug 18 19:11:28 2014 +0200
+++ b/servo/servo.ino	Thu Aug 21 11:12:55 2014 +0200
@@ -56,7 +56,10 @@
             }
             break;
         case 0xfd:
+            Serial.write(0xff);
             Serial.write(map(analogRead(A0), 0, 1023, 0, 255));
+            Serial.write(map(analogRead(A1), 0, 1023, 0, 255));
+            Serial.write(map(analogRead(A2), 0, 1023, 0, 255));
             break;
     }
 }