changeset 7:263bcda77a3b

Autostart
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Sat, 06 Jun 2015 13:55:35 +0200
parents f10747e8ce4f
children fbf9243c1444
files ubob.lua
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ubob.lua	Sat Jun 06 11:30:49 2015 +0200
+++ b/ubob.lua	Sat Jun 06 13:55:35 2015 +0200
@@ -1,4 +1,11 @@
-POSES = {{0, 10, 10}, {15, 10, 10}, {15, -10, -10}, {0, -10, -10}, {-15, -10, -10}, {-15, 10, 10}}
+POSES = {
+    {0, 10, 10},
+    {15, 10, 10},
+    {15, -10, -10},
+    {0, -10, -10},
+    {-15, -10, -10},
+    {-15, 10, 10}
+}
 
 sway_pos = 0
 left_pos = 0
@@ -17,10 +24,14 @@
     pwm.start(5)
     pwm.start(6)
     pwm.start(7)
-
     tmr.alarm(5, 25, 1, update)
+    gpio.write(2, 1)
 end
 
+function stop()
+    tmr.stop(5)
+    gpio.write(2, 0)
+end
 
 function next_pose()
     local pose = 0
@@ -68,3 +79,5 @@
         next_pose()
     end
 end
+
+start()