crwdns259700:0crwdne259700:0
crwdns259702:0crwdne259702:0
crwdns259704:0crwdne259704:0 crwdns259706:0crwdne259706:0
crwdns274208:0crwdne274208:0
crwdns274210:0crwdne274210:0
crwdns259712:0crwdne259712:0
- crwdns259714:0crwdne259714:0
 - crwdns259716:0crwdne259716:0 crwdns259718:0crwdne259718:0
 - crwdns259720:0crwdne259720:0
 - crwdns291058:0crwdne291058:0
 - crwdns259724:0crwdne259724:0 crwdns259726:0crwdne259726:0
 - crwdns259728:0crwdne259728:0 crwdns259730:0crwdne259730:0 crwdns259732:0crwdne259732:0 crwdns259734:0crwdne259734:0
 - crwdns259736:0crwdne259736:0
 
crwdns354362:0crwdne354362:0
- crwdns354364:0crwdne354364:0
 - crwdns354366:0crwdne354366:0
 - crwdns354368:0crwdne354368:0
 - crwdns354370:0crwdne354370:0
 - crwdns354372:0crwdne354372:0
 
crwdns354374:0crwdne354374:0
1# Python uses nanoteslas to measure magnetism.
2# Experiment with different numbers depending on the
3# strength of your magnet, which you can read by 
4# pressing button A.
5
6from microbit import *
7
8while True:
9    if button_a.was_pressed():
10        display.scroll(compass.get_field_strength())
11    if compass.get_field_strength() < 200000:
12        display.show(Image.ANGRY)crwdns354376:0crwdne354376:0
- crwdns354378:0crwdne354378:0
 - crwdns354380:0crwdne354380:0
 - crwdns354382:0crwdne354382:0
 
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.


