Skip to content
Advertisement

MicroPython count button clicks after 5 presses

I’m trying to count button click but only after 5 clicks and after the fifth click it will print the clicks BUT starting at 1.

JavaScript

I have the function below and when button_clicks() is called it displays and counts a 6,7,8 etc. instead 1,2,3 etc.

JavaScript

I also needed to add another two buttons B3 and B4 that would decrease or increase the number by 1. How would I do that?

Advertisement

Answer

I figured it out…. But still need a button to increase and a button to decrease the value.

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement