I want to change the value of a variable “Komma” with a push button.
Each time you click the button the value is to change.
- Click Komma = 5,
2nd click Komma = 1,
- click Komma again 5 and so on. A simple Swap-Function.
In VB I use the Int - Function on every Button Click:
a=a+1 if a/2=int(a/2) then Komma=5 else Komma=1 end if
How to do it on the Arduino? Was looking for swap function but found nothing that helped me.