Phuket2
Jun 03, 2015 - 16:47
I am sure this code has been done 1000 x 1000 times. But was sitting here thinking about when I can access the microphone (next release) , could change the ui to a blues mode, or heavy rock etc etc... Based on what song is playing. If done well, with a fade in and out could be nice. Ok, dreaming again.
import ui, motion
import sys
main_view = None
def motion_color():
if not main_view.on_screen :
motion.stop_updates()
sys.exit(999)
color= motion.get_attitude()
main_view.background_color = color
ui.delay(motion_color, .1)
if __name__ == '__main__':
v = ui.View()
main_view = v
motion.start_updates()
ui.delay(motion_color, .1)
v.present()