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.
4. Equality tests
int(elapsed_time()) == 5 is an equality test.
If the values on both sides of the equality operator (==) are the same then the test result is True. Otherwise the test result is False.
Note the use of a double equal sign, not just a single equal sign!
In our example, the equality test will become True after 5 seconds of elapsed time and turn False again after 6 seconds of elapsed time. This will result in our robot opening its eyes for one second only.