- Missing semicolon
- Didn’t set pinmode of buttonPin2 or ledPin2
- Didn’t call the function ‘checkButton2’
Function 1 blinks one LED once, then moves to the one to the right which is powered on and so on. When there are no more powered on to the right, it moves to the left-most LED and continues the same. This is because it uses an inclusive if statement instead of an else if while waiting between each of statement.
Function 2 blinks only the left-most LED which is powered on. This is because it uses an else if statement which is only true of the above conditions are false. Just like the previous one, it waits between each statement.
Function 3 blinks each LED at the same time. This one is all normal if statements, but does not delay the program until all of the values are changed for every LED instead of delaying after each value is changed.