Here is a flow diagram showing the steps in how a microprocessor controls the switching on and off of a street lamp:
[FLOW DIAGRAM]
1. Microprocessor checks if it is night time (using light sensor input)
2. If night, microprocessor switches on street lamp
3. Microprocessor starts timer
4. Microprocessor checks timer - if not expired, lamp remains on
5. If timer expires, microprocessor checks if it is still night time
6. If still night, microprocessor resets timer and lamp remains on
7. If no longer night, microprocessor switches off street lamp
8. Microprocessor stops - no further switching of lamp