Page 140 - Demo
P. 140

TI Python BootCamp VERDIEPING 4
while get_key() != "esc": ¨¨b=brightness.measurement()
¨¨if b < 0.5: ¨¨¨¨on.show_image(120,160) ¨¨¨¨for i in range(3): ¨¨¨¨¨¨set_color(0,0,0) ¨¨¨¨¨¨fill_circle(40+i*25,150,5) ¨¨¨¨¨¨sound.tone(100,0.2) ¨¨¨¨¨¨sleep(0.2) ¨¨¨¨¨¨sound.tone(0,0.2) ¨¨¨¨¨¨sleep(0.2)
¨¨¨¨for i in range(3): ¨¨¨¨¨¨set_color(254,19,0) ¨¨¨¨¨¨fill_rect(108+i*35,145,25,10) ¨¨¨¨¨¨sound.tone(200,0.5) ¨¨¨¨¨¨sleep(0.5) ¨¨¨¨¨¨sound.tone(0,0.2) ¨¨¨¨¨¨sleep(0.2)
¨¨¨¨for i in range(3): ¨¨¨¨¨¨set_color(0,0,0) ¨¨¨¨¨¨fill_circle(220+i*25,150,5) ¨¨¨¨¨¨sound.tone(100,0.2) ¨¨¨¨¨¨sleep(0.2) ¨¨¨¨¨¨sound.tone(0,0.2) ¨¨¨¨¨¨sleep(0.2)
¨¨¨¨sleep(0.3) ¨¨¨¨set_color(255,255,255) ¨¨¨¨fill_rect(30,145,250,18) ¨¨else: ¨¨¨¨off.show_image(120,160) ¨¨sleep(0.1)
Python GRAFISCH
    © 2020 T3 Nederland – T3 Vlaanderen
2
www.t3nederland.nl – www.t3vlaanderen.be

























































































   138   139   140   141   142