先上代码,以后再说
import time
class MyClass(GeneratedClass):
def __init__(self):
GeneratedClass.__init__(self)
self.tts = ALProxy('ALTextToSpeech')
def onLoad(self):
#put initialization code here
self.bIsRunning = False
self.ids = []
pass
def onUnload(self):
#put clean-up code here
pass
def onInput_onStart(self):
self.bIsRunning = True
id = self.tts.post.say("Hello")
time.sleep(2)
self.onInput_onStop()
pass
def onInput_onStop(self):
self.onStopped()
听说你还会走路了?瞧把你能的
import time
class MyClass(GeneratedClass):
def __init__(self):
GeneratedClass.__init__(self)
self.move = ALProxy('ALMotion')
def onLoad(self):
#put initialization code here
self.bIsRunning = False
self.ids = []
pass
def onUnload(self):
#put clean-up code here
pass
def onInput_onStart(self):
self.bIsRunning = True
id = self.move.post.moveTo(1,0,0)
time.sleep(15)
self.onInput_onStop()
pass
def onInput_onStop(self):
self.onStopped()