04 Quick Start

Problem

Your mission is to create a robot that reacts to how loud the environment is around it.


Design

Attach the loudness sensor as far away from the GoPiGo motors as you can. 


Build

Then plug the loudness sensor into an AD port.


Design: Your Code

Choose two robot behaviors: one when your robot detects a medium sound, and one when your robot detects a loud sound.


Code: Find Your Threshold

Use the sensor panel in Bloxter to gather some data about your environment. Write down the value when your environment is quietest, then try making some medium noises and loud noises. Write down those values, too!

Choose two threshold values: one that's in between silent and medium, and another that's in between medium and loud. 


Code: Lowest Threshold

Set up a conditional function and fill it in with what your robot will do when it reaches the first threshold.


Code: Highest Threshold

Set up a second conditional function and fill it in with what your robot will do when it reaches the second threshold.



Test

Test your robot with several different noises, especially new noises that you didn't investigate when you were first learning about the loudness sensor.



Iterate

Fine tune your program and consider adding some repeat blocks so it can continually monitor the environment.


Last modified: Tuesday, 6 October 2020, 3:01 PM