PA Designer Learn 2: LED and Loudness Sensor

This is the second challenge within the Robotics with GoPiGo and Python Curriculum.

Your task is to program your robot to alert a person with a hearing impairment to visiting house guests.

Learn how to use the Loudness Sensor alongside Jupyter Notebooks.

9. WHILE loops

To test the loudness sensor, we repeatedly read our sensor using a WHILE loop.

Where a FOR loop repeats a set of instructions a fixed number of times, a WHILE loop repeats those instructions for as long as a condition remains true.

In the test code above, when the program has been running for 10 seconds the elapsed_time() < 10 condition will no longer be true and we will stop looping.