Robot Programming: Colour/Traffic lights Challenge with colour sensor
Programming: Using the colour sensor to program our robot to go at the colour green, and stop at the colour red.
By completing this task, I was able to successfully program my robot to respond differently depending on the colour it saw. My basic knowledge of using the colour sensor from our previous task allowed my to understand and develop basic steps to allow me to design a pattern that allowed my robot to respond accordingly to each stage of the course. From completing this task, I learnt more intensely how I could program my robot to respond differently depending on the colour it sees. As I completed this challenge, I learnt how each step of my programming effected my robot. When I broke the task down, it was easier to understand how I should approach the task by breaking the challenge down into small steps that I wanted my robot to do to then overall complete the challenge. From completing the task, I was able to learn how I could program my robot to detect and respond to more than just one colour by adding extra boxes to the pattern and then making our robot respond to a particular colour differently. First we focused on programming our robot to detect greed and continue moving, which we learnt from our previous lesson using the colour sensor, and after a few runs and it was successful we incorporated red into the programming and making the robot stop.
A major issue I cam across when completing this task was adding in the extra commands after each colour into the programming. It was difficult to add the go and wait commands into our programming so our robot would stop when it detected red, and then continue going through the colour green. After several trials and error runs, we were able to create a working program for our robot that successful detected each colour and responded accordingly, however if we had more time I would've liked to have altered our pattern slightly so that our robot would continue to go through the green paper without stopping at all, and then getting it to completely stop at the colour red rather than just waiting until it moved. We were successful in being able to complete the course despite what order the colours were in. We also had difficulty with the direction our robot was moving it, as when we tried to make it go in a straight path it would always move on an angle however I believe it is due to some defect in the construction of the robot rather than the programming, so I would just like time to reconstruct my robot and resolve any potential errors that may have been made when it was first built.
If we had been able to program our robot to detect the colour yellow too, that would've been interesting to see whether it would've worked as efficiently as the red and green pattern did too, but I would've been pleased if we were able to program our robot to stop completely at the colour red rather than just waiting for a few seconds, and it is something I would like to alter in our programming. If we learned more about how to incorporate different colours into our patterns when we're programming our robot to detect several different colours, it would've been easier to complete this task.