diff --git a/test_routine.tingapp/main.py b/test_routine.tingapp/main.py index dff4e24..6ca359f 100644 --- a/test_routine.tingapp/main.py +++ b/test_routine.tingapp/main.py @@ -1,7 +1,7 @@ import tingbot from tingbot import * +import time -# setup code here state = { 'screen': 0, } @@ -10,7 +10,7 @@ def tick(): state['screen'] += 1 - if state['screen'] > 2: + if state['screen'] > 3: state['screen'] = 0 if state['screen'] == 0: @@ -22,6 +22,15 @@ def tick(): elif state['screen'] == 2: screen.fill(color='grey') screen.text('Hello world!', color='white') + elif state['screen'] == 3: + screen.fill(color='white') + screen.text('Backlight!', color='black') + screen.update() + time.sleep(0.25) + + for brightness in [75, 50, 25, 0, 25, 50, 75, 100]: + screen.brightness = brightness + time.sleep(0.25) @touch() def on_touch(xy):