Hello,
I want to be able to press a button and it adds 1, and it displays it on the micro:bit. How would I be able to do this?
Thanks.
Coding it to a counter.
Re: Coding it to a counter.
You will want to read this: http://microbit-micropython.readthedocs ... ttons.html and this: http://microbit-micropython.readthedocs ... mages.html
-
- Posts: 168
- Joined: Tue Nov 07, 2017 11:45 pm
Re: Coding it to a counter.
Code: Select all
from microbit import *
total=0
while True:
if button_a.is_pressed():
total+=1
display.scroll(str(total),wait=False)