Part 1

Errors:

  1. Missing semicolon
  2. Didn’t set pinmode of buttonPin2 or ledPin2
  3. Didn’t call the function ‘checkButton2’

https://www.tinkercad.com/things/8WfBqlj7kEt

Part 2

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.

Function Thing:

https://www.tinkercad.com/things/gC0LXiENNDT


0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.