Week 7 – James

 

Hi its James here.  This week we started looking at the ultrasonic sensor and what it does. This is what an ultrasonic sensor looks like:

An ultrasonic sensor is an instrument that measures the distance to an object using ultrasonic sound waves.

An ultrasonic sensor uses a transducer to send and receive ultrasonic pulses that relay back information about an object’s proximity.

High-frequency sound waves reflect from boundaries to produce distinct echo patterns.

Our first challenge was to stop at a wall with the ultrasonic sensor. All of us (excluding Josh because wasn’t here) had troubles at the start like how we had to change the code for the port for the ultrasonic sensor from port 4 to port 1 because that is where we had plugged the sensor into but we agreed to change the plug the sensor was plugged into port from port 1 to port 4. This is my solution.

Our second challenge was to control the robot with The Force! (that’s in Star Wars). I would have thought that if you didn’t know about Star Wars I would think I’m magic. But this is the code I wrote to do it.

But if you truly want to master the force, this is my code.
As you can see I have used comments to tell you what the block does. For example you can see that in every coding bit (except for the first one) that I have used comments to tell you what one or many blocks do.

We found discrepancies in the teaching booklet because the code to Truly Master the Force had the wrong comment in 2 places. (They where in <15 cm move backward and >20cm move forward).  It should have been the other way around like you can see in my code.

When we learned about the mini sounds that the ultrasonic sensor can hear we looked up how well can a human can hear. This is the information on it.

While 20 to 20,000 Hz forms the absolute borders of the human hearing range, our hearing is most sensitive in the 2000 to 5000 Hz frequency range. As far as loudness is concerned, humans can typically hear starting at 0 dB.

Before I go the word of the day is

Eschew Deliberately avoid using

This is the end of my post so I’m over and out. Goodbye!