Week 6 – Brayden

This week we completed two line following challenges using the colour and touch sensors. At the start of the lesson we were given a challenge where we had to programme the Mindstorm to follow the right side of a line.

This had to be completed by programming the mindstorm to ‘zigzag’ across the edge of the line by using a switch in the code.

We used the switch to determine whether the Mindstorm was on the black line or on the white of the track. If it was on the black it would turn slightly to the right and move in that direction. If it was on the white it would turn slightly to the left and move in that direction. This would cause the Mindstorm to cross back and forth over the edge of the line. At first there were a few bugs in the code but after some alterations to the code we all achieved this.

My Line Follower Challenge 1 Code (Explanation in the blue comment blocks)

We then attempted another challenge. In this challenge we had to use the code we had just created and alter it so if the touch sensor was pressed the Mindstorm would stop moving. We achieved this challenge fairly quickly.

My Code for the Line Follower Challenge 2

I am looking forward to testing my coding knowledge in future weeks.