-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhelloworldohbot.py
59 lines (37 loc) · 980 Bytes
/
helloworldohbot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# import the ohbot module
from ohbotWin import ohbot
# Reset Ohbot
ohbot.reset()
# Move turn ohbot's head and eyes.
ohbot.move(1,2)
ohbot.move(3,1)
# Wait a few seconds for the motors to move
ohbot.wait(2)
# Move head back to the centre and say "Hello World"
ohbot.move(1,5,1)
ohbot.say("Hello World")
# Slowly increase the brightness of the eyes.
for x in range(0,10):
ohbot.eyeColour(x,x,x)
ohbot.wait(0.1)
ohbot.eyeColour(0,0,0)
ohbot.wait(0.2)
ohbot.move(1,5,1)
ohbot.wait(1)
ohbot.say("Now I am running in python you know",False)
for x in range (0,10):
ohbot.move(3,x)
ohbot.eyeColour(x,10-x,x)
ohbot.wait(0.3)
ohbot.say("I can do the robot")
for y in range(0,4):
for x in range(0,10):
ohbot.move(y,x)
ohbot.eyeColour(y,x,10-x)
ohbot.wait(0.2)
ohbot.reset()
ohbot.say("and ventriloquism",True,False)
ohbot.eyeColour(0,0,10)
ohbot.wait(1)
# close ohbot at the end.
ohbot.close()