Week 7 – Brayden

This week in robotics class we began to use the ultrasonic sensor. The ultrasonic sensor uses sound waves that are at a higher frequency than human beings can hear to detect and measure the distance to an object. We began the session by taking on a challenge in which we had to use the ultrasonic sensor. For this challenge we had to programme the mindstorm to move until it was 20cm away from a wall. We achieved this task fairly quickly.

My code for the first ultrasonic challenge.

After completing this challenge we moved on to a second challenge in which we had to programme the mindstorm so if it was closer than 20cm to an object it would move backwards and otherwise move forwards. This was called ‘Using the Force’.

My code for the second challenge

We then attempted one final challenge for which we used the same code as challenge 2 but if the Mindstorm was between 15-20cm it would ‘rest’ and stop. In this challenge we were ‘Mastering the Force’.

My code for ‘Mastering the Force’

While completing the challenges this week we noticed some discrepancies in the comment blocks of the challenge solutions.