Skip to content

crwdns342183:0crwdne342183:0

crwdns312254:0crwdne312254:0

crwdns338145:0crwdne338145:0 | MakeCode, Python | crwdns255566:0crwdne255566:0, crwdns255568:0crwdne255568:0, crwdns255570:0crwdne255570:0 | crwdns258504:0crwdne258504:0, crwdns258538:0crwdne258538:0, crwdns258544:0crwdne258544:0

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