Exercice : Mini Challenge
Mini Challenge 3: Sound Sentences
You can have multiple sounds play one after another to form sentences. Try adding a second Sound Block to your program so it says "Object Detected" instead of just "Hello"!
"Object" and "Detected" can be found as separate sound files in the "Information" folder.
Question
Mini Challenge 4: Sensor Change Mode
In addition to "Comparing" the value of the sensor against the Threshold, the Wait Block can also look at the amount the sensor value has changed since the command started.
Question
Place an object in front of the Ultrasonic Sensor.
Change the Mode of the Wait Block to Ultrasonic Sensor - Change - Distance Centimeters.
Set the direction setting to "Any" (2).
Set the Amount setting to "5".
Run program, then move object 5cm closer to or further away from Ultrasonic Sensor.
Explain what happens.
Solution
The Wait Block ends and the alarm sounds whenever the Ultrasonic Sensor's value has changed by more than 5 centimeters from the time it started Waiting.