from microbit import *

compass.calibrate()

N = Image("00900:"
          "09990:"
          "90909:"
          "00900:"
          "00900:")

S = Image("00900:"
          "00900:"
          "90909:"
          "09990:"
          "00900:")

while True:
    if compass.heading() < 90 or compass.heading() > 270:
        display.show(N)
        sleep(1000)
        display.clear()
    else:
        display.show(S)
        sleep(1000)
        display.clear()