1. Configure hardware modules and declare pins.
2. Print text on LCD display.
3. Set Servo position from 10 to 170 degree.
4. Delay for the speed of the Servo. (Higher the number the slower the Servo)
5. Set Servo position back from 170 to 10 degree. NOTE: The fan motor is in the way if we set position at 0 to 180. You can adjust the position by changing the values to your liking. Try 20 and 100.
6. Set a procedure to print distance on our LCD display.
NOTE:
- The use of the procedure can shorten your program code dramatically.
- It is very usefully when you need to write repeated sets of codes.
7. Set another procedure for LED and Buzzer ON and OFF IF threshold of 1 meter is met.
8. Call on our 2 Procedures.
9. UPLOAD PROGRAM.









Comments