Exemplo n.º 1
0
    picoh.move(picoh.HEADNOD, x)
    picoh.wait(0.2)

picoh.move(picoh.HEADNOD, 5)

picoh.say("Commencing random movement")

count = 0

while count < 10:
    picoh.move(picoh.HEADTURN, random.randint(2, 8))
    picoh.move(picoh.HEADNOD, random.randint(2, 8))
    picoh.move(picoh.EYETILT, random.randint(2, 8))
    picoh.move(picoh.EYETURN, random.randint(2, 8))
    count = count + 1
    picoh.wait(random.random() * 2)

picoh.reset()

picoh.say("playing sound")

picoh.playSound('spring')

picoh.say("Random phrase from speech database")

picoh.say(picoh.getPhrase())

picoh.reset()
picoh.say("Goodbye")
picoh.close()
Exemplo n.º 2
0
def bKey(event):
    picoh.playSound('spring',untilDone = True)
    picoh.say("What is going on ?",untilDone = False)
    picoh.setBaseColour(10,3,3)
Exemplo n.º 3
0
# Example of how to use the play sound function and change the base colour of Picoh.

from picoh import picoh
import random

picoh.reset()
picoh.wait(1)
picoh.close()
picoh.move(picoh.LIDBLINK, 0)

picoh.setEyeShape('Heart')
picoh.setEyeBrightness(0)
picoh.playSound('fanfare', untilDone=False)
picoh.wait(1.5)

picoh.move(picoh.LIDBLINK, 5)
picoh.setEyeBrightness(5)

picoh.wait(1)

picoh.move(picoh.LIDBLINK, 10)
picoh.setEyeBrightness(10)
picoh.wait(2)
picoh.setEyeBrightness(7)
picoh.wait(4)

picoh.playSound('ohbot', untilDone=False)

picoh.setEyeShape('Glasses')
for x in range(0, 40):
    picoh.setBaseColour(random.randrange(0, 10), random.randrange(0, 10),