// Saves the current error so it can be the lastError next time
lastError = error;
Thread.sleep(5);
}
Car.stop();
LCD.clear();
LCD.drawString("Program stopped", 0, 0);
LCD.refresh();
}
}
```
##### CodeSnippet1: The implement code in our PID controlled line follower program.
#### Conclusion
#### Conclusion
...
@@ -112,7 +179,9 @@ Lastly, we will check if it Is possible to use the color sensor for both followi
...
@@ -112,7 +179,9 @@ Lastly, we will check if it Is possible to use the color sensor for both followi
### Overall Conclusion
### Overall Conclusion
### References
### References
1.Sourcecode for the programs in this lesson can be found in [Lesson4programs.zip.](http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson4.dir/Lesson4programs.zip)
1.The sourcecode for the programs, in this lesson, can be found in [Lesson4programs.zip.](http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson4.dir/Lesson4programs.zip)
2.[A PID Controller For Lego Mindstorms Robots.](http://www.inpharmix.com/jps/PID_Controller_For_Lego_Mindstorms_Robots.html)
2.[A PID Controller For Lego Mindstorms Robots.](http://www.inpharmix.com/jps/PID_Controller_For_Lego_Mindstorms_Robots.html)