View difference between Paste ID: ZtgMYs02 and 123c5xcU
SHOW: | | - or go back to the newest paste.
1
from microbit import *
2
3
if compass.is_calibrated() == False:
4
    compass.calibrate()
5
6
while True:
7
    needle = ((15 - compass.heading()) // 30) % 12      # 측정된 방위각을 12개로 나눈다.
8
    display.show(Image.ALL_CLOCKS[needle])