Final Coding
After determining the threshold figure from road testing we could now finalise the coding for the system. The aim is to get the system to print the values being read so that it can be monitored. We also want the system to flash the brake lights for 5 seconds if the readings drop below 290, and complete the circuit at all other times so that the brakes work normally. Since the sensor only dropped below 290 once during testing we figured that the flashing needs to be timed so that it will keep flashing even though the sensor may not still be reading below 290.The screenshots above show the coding with the functions also described in the pictures. The system is set to make pin 4 high at all other times because a normally open relay was used for demonstration purposes because we could not find a normally closed. This means the relay will be closed at all other times because it has power to it.
No comments:
Post a Comment