-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,59 @@ | ||
# import the ohbot module | ||
|
||
from ohbot 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() |