Simultanious Motor Loops and Button (Motorshield)

Your code doesn't compile - too many closing braces in the loop function.

More seriously you have two potentially infinite while loops. This:

  while (button1Old == 0 && button1New == 1)

Is broken because if the condition is true, the loop will never end. This because you don't read the button in the loop.

1 Like