Programming a robot using 'Lego Mindstorms' with Colour Sensor
Programming: Detecting the colours red, green and yellow
What was the most difficult part of this challenge?
Whilst completing this challenge, I found it difficult to determine how to program our robot to detect multiple colours, and identifying mistakes within our programming. Our programming wasn't successful in complying with our intentions, and so it was challenging to figure out what was going wrong. We didn't understand what part of our programming was incorrect and was causing our robot to unsuccessfully detect any of the colours, which ultimately was the greatest challenge of all. Trying to determine what needed alterations and changing was the most difficult part, because without identifying the problems we weren't able to make the appropriate changes that would allow our robot to function properly and the fix the program so that our robot would detect colour.
How did you go about solving it?
To solve it, I was stumped with at first. I constantly kept re-rereading the instructions and guidelines to ensure that my pattern was correct, and I couldn't find any faults with that. So then I decided to do some trial and error runs and still I could't identify what was the issue. I decided to keep the robot connected to the computer so I could follow the programming as the robot completed each action and still I had difficulty determining what alterations needed to be made. It wasn't until I decided to redo the whole pattern from scratch, and complete the whole program step by step again was it that I finally indicated the mistake. I was quite surprised to see how such small mistakes with our pattern had such big effects with the programming, and as I began to redo the pattern I realised that the wrong port had been written at the top of the box, and so the robot didn't recognise that the colour sensor was actually in port 4, but the programming said port 3. This partially fixed the issue but then we were unable to get our robot to detect the colour red, until further inspection and construction made me realise that we'd forgotten to tick the red box in the wait command so that our robot would be programmed to also detect the colour red as well as green. So it wasn't until I went over our entire programming step by step again and understood what each part of my pattern made the robot do and I understood what I wanted each part to do was I able to identify the faults within our programming that were causing problems wiht our robot.