crwdns274478:0crwdne274478:0
crwdns274480:0crwdne274480:0
crwdns274482:0crwdne274482:0
crwdns274484:0crwdne274484:0
crwdns274486:0crwdne274486:0
crwdns274488:0crwdne274488:0
- crwdns274490:0crwdne274490:0
- crwdns274492:0crwdne274492:0
- crwdns274494:0crwdne274494:0
- crwdns274496:0crwdne274496:0
crwdns274498:0crwdne274498:0
- crwdns274500:0crwdne274500:0
- crwdns274502:0crwdne274502:0 crwdns274504:0crwdne274504:0
- crwdns274506:0crwdne274506:0 crwdns274508:0crwdne274508:0
- crwdns274510:0crwdne274510:0
- crwdns274512:0crwdne274512:0
crwdns274514:0crwdne274514:0
- crwdns291406:0crwdne291406:0 crwdns274518:0crwdne274518:0
- crwdns274520:0crwdne274520:0
- crwdns274522:0crwdne274522:0 crwdns274524:0crwdne274524:0
- crwdns274526:0crwdne274526:0 crwdns274528:0crwdne274528:0 crwdns274530:0crwdne274530:0
- crwdns274532:0crwdne274532:0 crwdns274534:0crwdne274534:0 crwdns274536:0crwdne274536:0 crwdns274538:0crwdne274538:0
- crwdns274540:0crwdne274540:0
- crwdns274542:0crwdne274542:0
- crwdns274544:0crwdne274544:0
crwdns274546:0crwdne274546:0
- crwdns274548:0crwdne274548:0
- crwdns274550:0crwdne274550:0
- crwdns274552:0crwdne274552:0
crwdns274554:0crwdne274554:0
1from microbit import *
2time = 0
3start = 0
4running = False
5
6while True:
7 if running:
8 display.show(Image.HEART)
9 sleep(300)
10 display.show(Image.HEART_SMALL)
11 sleep(300)
12 else:
13 display.show(Image.ASLEEP)
14 if button_a.was_pressed():
15 running = True
16 start = running_time()
17 if button_b.was_pressed():
18 if running:
19 time += running_time() - start
20 running = False
21 if pin_logo.is_touched():
22 if not running:
23 display.scroll(int(time/1000))
crwdns274556:0crwdne274556:0
- crwdns274558:0crwdne274558:0
- crwdns274560:0crwdne274560:0
- crwdns274562:0crwdne274562:0 crwdns274564:0crwdne274564:0
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.