def sel(): global button, stage, lipMaxRaw, lipMinRaw if stage == 2: root.destroy() picoh.reset() picoh.wait(1) picoh.close() sys.exit() if stage == 1: ResetRangeToRawMin() label.config(text="All done!") stage = 2 button.config(text="Close") if stage == 0: selection = "Value = " + str(var.get()) label.config( text= "Slowly move the slider to the right, stop when the bottom lip pops the top lip into a smile." ) button.config(text="Set Smile Point") ResetRangeToRawCentre() stage = 1 # Set headnod to 5 picoh.move(picoh.HEADNOD, 10) # Move bottom lip to 4 picoh.move(picoh.BOTTOMLIP, 4) # Wait 250ms picoh.wait(0.25) # Move bottom lip to 6 picoh.move(picoh.BOTTOMLIP, 6)
from picoh import picoh # Reset picoh's motors and wait a second for them to move to rest positions. picoh.reset() picoh.wait(1) # Set Picoh's eye shape. picoh.setEyeShape("Eyeball") # Say a phrase. picoh.say("Hello my name is Picoh. Good to meet you") # Move the HEADTURN and EYETURN to position 3. picoh.move(picoh.HEADTURN, 3) picoh.move(picoh.EYETURN, 3) picoh.wait(1) # Move the HEADTURN and EYETURN to position 7. picoh.move(picoh.HEADTURN, 7) picoh.move(picoh.EYETURN, 7) # Set the base to red:3/10 green: 4/10 and blue 2/10. picoh.setBaseColour(3, 4, 2) picoh.wait(1) # Change the base to orange picoh.setBaseColour(10, 3, 0) # Set the eyeshape to SunGlasses picoh.setEyeShape("SunGlasses")
def on_closing(): picoh.reset() picoh.wait(1) picoh.close() win.destroy()