I have a bit of code that increments a variable each time pin 0 is touched. After incrementing, it scrolls the new value of the variable across the LEDs. Funny thing is, it works great on the simulator, but doesn’t work at all on the Micro:bit controller.
Touches
from microbit import *
touches = 0
while True:
if pin0.is_touched():
touches += 1
display.scroll(str(touches))