PA Designer Learn 4: More Python Commands

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.

1. Making Decisions

We all have to make decisions in life. For instance, imagine you were about to go outside. If it were raining you would take an umbrella with you, wouldn’t you? You’ve just made a decision!

Your robot is no different. It will have to decide when to stop listening for the bell and turn the light on. The way it makes decisions is with conditional statements. In Python code , these take the following form:

if condition:
    action

Don’t forget the colon after the condition and indentation of the action code. Both are important!