from microbit import * # indentations in text are important # analogue input on port 0 # (** need a low pass filter on i/p **) # use 0 and 3V to rotator pot # 128 units between each arrow # but N displayed twice (0 and 360) so 64 each while True: voltage = pin0.read_analog() if voltage >0 and voltage <64: display.show(Image.ARROW_N) if voltage >65 and voltage <192: display.show(Image.ARROW_NE) if voltage >193 and voltage <320: display.show(Image.ARROW_E) if voltage >321 and voltage <448: display.show(Image.ARROW_SE) if voltage >449 and voltage <576: display.show(Image.ARROW_S) if voltage >577 and voltage <704: display.show(Image.ARROW_SW) if voltage >705 and voltage <832: display.show(Image.ARROW_W) if voltage >833 and voltage <960: display.show(Image.ARROW_NW) if voltage >961 and voltage <1024: display.show(Image.ARROW_N) sleep(100)