Lab 2 - Multi LED Challenges

Mandatory Challenges

These challenges are part of the course and you must do them.

Part 1:

Modify the efficient program version so that it uses for-loops in the loop function. The loop function would be 13 lines total (including 1 line per {curly bracket}).

Part 2:

Write a program that uses 6 LED's where the EVEN numbered LED's light up (LED#2, LED# 4, LED#6) and then the ODD numbered LED's light up (1,3,5), and then repeats backwards (6,4,2) then (5,3,1).

Make the Loop function use for-loops like you did in Part 1.

Additional knowledge:
In a for-loop, to get x to count up by two, instead of using x++, write x+=2.
x-=2 would make it count down by 2.
Additional knowledge:
less than or equal to: <=
greater than or equal to: >=
Example to count up by 25 to 100: for (x=1; x <=100; x+=25)
Example to count down by 20 from 100 to 0: for (x=100; x>=0; x-=20)

Stuck?  Try Lab 2 - Mandatory Challenge - Hint 1

Submitted Challenges

These are submitted by other students and you can challenge yourself by trying them or making your own using the template.