What you see above is our ‘PID’ programming code for a LEGO robot following a line. It follows lines so smoothly that you can’t even see it wobbling. The P in the PID is just a basic line follower, the I looks at the past and uses those numbers to make it smoother. The coolest one is the D which looks for patterns to predict the future readings. To make it, we had to use a lot of variables and constants in our program. We were amazed when we tested it and it worked because most of the time we had to trouble-shoot our program. As you can see, it is very long so when we finished it we made it into a “my block”.