I highly recommend you goto: https://www.arduino.cc/en/Tutorial/HomePage and read the tutorials, they will help you a lot. ledState1 = !ledState1; "!" is the not changes the state of ledState from a 1 to a zero or if zero to a 1. Hopefully that will help.