Пример #1
0
def endAndRest():
    ohbot.reset()
    ohbot.wait(1)
    ohbot.move(3, 0, 2)
Пример #2
0
# module level variable to stop it going off twice
lastm = ""


# this is called on a separate thread to blink the eyes while running
def blinkLids():
    while (blinking):
        ohbot.move(ohbot.LIDBLINK, 0)
        sleep(0.2)
        ohbot.move(ohbot.LIDBLINK, 10)
        # wait for a random amount of time for realistic blinking
        sleep(randint(0, 4))


# start up sequence resets to mid position, sets the eyes to blue then goes to sleep
ohbot.reset()
ohbot.eyeColour(0, 0, 10)
sleep(1.0)
ohbot.eyeColour(0, 0, 0)
ohbot.move(ohbot.HEADNOD, 0)
ohbot.move(ohbot.LIDBLINK, 0)
sleep(2.0)
# close to turn the motors off
ohbot.close()

while (True):
    # get seconds and minutes into strings
    s = strftime("%S", localtime())
    m = strftime("%M", localtime())
    # set this to False for testing to make Ohbot speak continuously
    everyQuarterHour = False  #make True for every 15 mins
Пример #3
0

def chooseShower():

    choice = random.randint(1, 2)
    print(choice)

    if choice == 1:
        showerFirst = "Michelle"
    elif choice == 2:
        showerFirst = "Sean"

    return showerFirst


ob.reset()
ob.wait(1)

ob.setVoice("Samantha")

ob.say("Ah I'm awake. Did you need me?")

listOfMoves = [i for i in range(random.randint(40, 60))]
print(len(listOfMoves))

for move in listOfMoves:
    chooseBigOrSmall()

ob.reset()
ob.wait(1)