Skip to content

crwdns342183:0crwdne342183:0

crwdns311996:0crwdne311996:0

crwdns338145:0crwdne338145:0 | MakeCode, Python | crwdns255566:0crwdne255566:0, crwdns255568:0crwdne255568:0 | crwdns258500:0crwdne258500:0, crwdns258502:0crwdne258502:0, crwdns258504:0crwdne258504:0, crwdns258516:0crwdne258516:0, crwdns258538:0crwdne258538:0, crwdns258544:0crwdne258544:0, crwdns258612:0crwdne258612:0

crwdns255622:0crwdne255622:0

crwdns255624:0crwdne255624:0

crwdns255626:0crwdne255626:0

crwdns255628:0crwdne255628:0

crwdns255630:0crwdne255630:0

  • crwdns255632:0crwdne255632:0 crwdns255634:0crwdne255634:0
  • crwdns255636:0crwdne255636:0 crwdns255638:0crwdne255638:0
  • crwdns255640:0crwdne255640:0 crwdns255642:0crwdne255642:0 crwdns255644:0crwdne255644:0

crwdns255646:0crwdne255646:0

  • crwdns255648:0crwdne255648:0
  • crwdns255650:0crwdne255650:0
  • crwdns255652:0crwdne255652:0
  • crwdns255654:0crwdne255654:0

crwdns255656:0crwdne255656:0

1from microbit import *
2compass.calibrate()
3
4while True:
5    bearing = compass.heading()
6    if bearing < 45 or bearing > 315:
7        display.show('N')
8    else:
9        display.show(' ')
10

crwdns255658:0crwdne255658:0

  • crwdns255660:0crwdne255660:0
  • crwdns255662:0crwdne255662:0
  • crwdns255664:0crwdne255664:0
crwdns255666:0crwdne255666:0