[tuxdroid-svn] r4649 - software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/executable
Status: Beta
Brought to you by:
ks156
|
From: jerome <c2m...@c2...> - 2009-05-07 09:55:52
|
Author: jerome
Date: 2009-05-07 11:55:43 +0200 (Thu, 07 May 2009)
New Revision: 4649
Modified:
software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/executables/tuxdroid-gadget-maxlight.py
Log:
* Fixed a dummy bug.
Modified: software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/executables/tuxdroid-gadget-maxlight.py
===================================================================
--- software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/executables/tuxdroid-gadget-maxlight.py 2009-05-07 08:19:30 UTC (rev 4648)
+++ software_suite_v2/software/gadgets/tuxdroid-gadget-maxlight/trunk/executables/tuxdroid-gadget-maxlight.py 2009-05-07 09:55:43 UTC (rev 4649)
@@ -67,10 +67,8 @@
from tuxisalive.api import *
from time import sleep, time
from GadgetHelper import GadgetHelper
-import threading
+import threading
-currentTime = 0;
-
def tuxConnect():
'''
Wait connected
@@ -132,6 +130,7 @@
Tux stop when it finds light up Modified by ks156 who wrote light
monitor gadget for TuxDroid V1 Tux turn a little, wait and turn while light < light max
'''
+ brk = False
while 1:
tux.spinning.leftOnDuring(0.1, speed=SPV_VERYSLOW)
@@ -143,12 +142,13 @@
break
if (int(time()) - currentTime) >= 20:
- throwMessage("Sorry I'm not sure where the most of the light is coming from")
- break;
+ GadgetHelper.throwMessage("Sorry I'm not sure where the most of the light is coming from")
+ tux.spinning.off()
+ brk = True
+ break
- currentTime = int(time())
-
- GadgetHelper.throwMessage("I think most of the light is coming from this direction.")
+ if not brk:
+ GadgetHelper.throwMessage("I think most of the light is coming from this direction.")
tgp_language = "en"
@@ -181,8 +181,7 @@
tux.eyes.open()
tux.flippers.up()
light = search() # search light up
- currentTime = int(time())
- stop(light, currentTime) # stop
+ stop(light, int(time())) # stop
tux.flippers.down()
tux.access.release()
|