Arduino (While Loops)

Field & Cluster
Design, Production & Repair Architecture and Construction Engineering Manufacturing
Equipment/Materials Needed


Arduino
Leads
LED
Potentiometer


while loop
Description


While loops give us increased flexibility in our coding. For loops are based on counters, while loops are set on parameters.

Badge Completion Requirements

Developing "While Loops"

In the last two lessons, you have learned the ins and outs of programming with For Loops. There are similar loops called While Loops. In this video, we show you how to program using While Loops. Anything that can be done with a For Loop can also be done with a While Loop. Which one you use is just a matter of preference.

Please gather the required materials and following along:

Prompt

Please design, develop and code while the analogRead value is above 1000 the red LED comes on. When the analogRead value is less than 1000 the yellow LED comes on and the red LED goes off. When the analogRead value is less than 750 the green LED comes on and the yellow LED goes off.

Compare and contrast the "for loop" and "while loop" 

 

Please develop and submit a presentation demonstrating your understanding and skill at developing and using a while loop. Please include the above "prompts" in your presentation