Repeat a certain part of code.

  if (buttonState = 1)

Look up the difference between an assignment "=" and a comparison "==".

Pete