Pandora's Box
In this challenge we had to use a gyro sensor to detect any unauthorized opening and then sound an alarm. In this version of GLaDos we perfected the art of security. When a thief tries to steal our precious wiffle balls by improperly opening the box it will sound an alarm which will alert the nearest guards and they will escort the criminal to a free interrogation room where they will be swiftly dealt with. In the video below an aperture scientist demonstrates the security of the GLaDos 0.01.
This picture shows the program itself.
The main problem with the program is that even when the alarm was shut off it would go off. The programers fixed it by making input variables so if the gyro sensor went off the variable would be equal to 1, and when the motion sensor was activated the variable would equal 0 and would lead to no alarm. In this challenge we learnt how to use a gyro sensor and how to use variables, we figured it out through trial and error.