crwdns339297:0crwdne339297:0
crwdns339299:0crwdne339299:0
crwdns339301:0crwdne339301:0
crwdns339305:0crwdne339305:0
crwdns339307:0crwdne339307:0
crwdns339311:0crwdne339311:0
- crwdns339313:0crwdne339313:0
- crwdns339315:0crwdne339315:0
- crwdns339317:0crwdne339317:0
- crwdns339319:0crwdne339319:0
crwdns339321:0crwdne339321:0
crwdns339323:0crwdne339323:0 crwdns339325:0crwdne339325:0 crwdns339327:0crwdne339327:0
crwdns339329:0crwdne339329:0
crwdns339331:0crwdne339331:0
crwdns339333:0crwdne339333:0
crwdns339335:0crwdne339335:0
crwdns339337:0crwdne339337:0 crwdns339339:0crwdne339339:0
crwdns339341:0crwdne339341:0
crwdns339343:0crwdne339343:0
crwdns339345:0crwdne339345:0 crwdns339347:0crwdne339347:0
crwdns339349:0crwdne339349:0
crwdns339351:0crwdne339351:0
- crwdns339353:0crwdne339353:0
- crwdns339355:0crwdne339355:0
- crwdns339357:0crwdne339357:0
- crwdns339359:0crwdne339359:0
- crwdns339361:0crwdne339361:0
crwdns339363:0crwdne339363:0
crwdns339365:0crwdne339365:0
crwdns339371:0crwdne339371:0
1from microbit import *
2
3# The Python version of this project has sleep()
4# for each button press to make the A+B button work better
5
6while True:
7 if button_a.is_pressed() and button_b.is_pressed():
8 display.scroll(display.read_light_level())
9 sleep(200)
10 elif button_a.is_pressed():
11 display.scroll(temperature())
12 sleep(200)
13 elif button_b.is_pressed():
14 sleep(200)
15 display.scroll(microphone.sound_level())
crwdns339373:0crwdne339373:0
- crwdns339375:0crwdne339375:0
- crwdns339377:0crwdne339377:0
- crwdns339379:0crwdne339379:0
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.