if (iButton == 1)
{
for (int counter = 0; counter < 2; counter ++)
{
if(counter == 0)
{
currentTapRead = currentTapRead * 0.5;
printf("1/2\n");
}
if(counter == 1)
{
currentTapRead = currentTapRead * 2;
printf("1\n");
}
}
}
}
Hi guys, im trying to make it so that when a button is tapped, it will divide something by 2, when the button is tapped again, it is multiplied by 2 then goes back to the start. the problem is when i hit the button it does them both at the same time. therefore does nothing.. I need to find a way to make the counter only count up 1 at a time instead of up the whole sequence however you cant just put count + 1 in the for loop.
Anyone have any ideas?