State change detection


hi. new arduino programming , forum. want code turning relay on , off momentary pushbutton, 1 click on, next click off. found public code: https://www.arduino.cc/en/tutorial/statechangedetection , changed the   if (buttonpushcounter % 4 == 0) { to  if (buttonpushcounter % 2 == 0) { , worked...

but efficiant way achieve purpouse?

br
staffan

if need 2 states use boolean true false values. 


Arduino Forum > Using Arduino > Programming Questions > State change detection


arduino

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

esp8266 (nodemcu 0.9) client.write très lent ???