Compass python microbit example
from microbit import * if compass.is_calibrated() == False: compass.calibrate() while True: needle = ((15 - compass.heading()) // 30) % 12 # 측정된 방위각을 12개로 나눈다. display.show(Image.ALL_CLOCKS[needle])
from microbit import * if compass.is_calibrated() == False: compass.calibrate() while True: needle = ((15 - compass.heading()) // 30) % 12 # 측정된 방위각을 12개로 나눈다. display.show(Image.ALL_CLOCKS[needle])
Comments