Little help here please
i have arduino uno , want use pushbutton turn on led turn off 1 push turns on 2 push turns off idea how might , going using 4 pushbuttons. thanks
you use count push button presses.
eg
int buttoncount = 0;
if (button == high) // if pressed
{
if(buttoncount == 0)
{
turn on
buttoncount++;
}
if(buttoncount == 1)
{
turn off
buttoncount = 0;
}
}
eg
int buttoncount = 0;
if (button == high) // if pressed
{
if(buttoncount == 0)
{
turn on
buttoncount++;
}
if(buttoncount == 1)
{
turn off
buttoncount = 0;
}
}
Arduino Forum > Using Arduino > Programming Questions > Little help here please
arduino
Comments
Post a Comment