Skip to content

Commit

Permalink
Add brightness testing code
Browse files Browse the repository at this point in the history
  • Loading branch information
joerick committed Jun 28, 2016
1 parent 2cca0f3 commit 755bab7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test_routine.tingapp/main.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import tingbot
from tingbot import *
import time

# setup code here
state = {
'screen': 0,
}
Expand All @@ -10,7 +10,7 @@
def tick():
state['screen'] += 1

if state['screen'] > 2:
if state['screen'] > 3:
state['screen'] = 0

if state['screen'] == 0:
Expand All @@ -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):
Expand Down

0 comments on commit 755bab7

Please sign in to comment.