Design a program using Raspberry Pie. Program the following using Python. Kickboard warning notification system - A
Question:
Program the following using Python.
Kickboard warning notification system
- A kickboard warning notification system applied with a rear detection sensor is implemented using an ultrasonic sensor, a buzzer, a switch, LEDs, and a Raspberry Pie.
Operation process
(1) Measure the distance between the kickboard and the rear vehicle through an ultrasonic sensor.
(2) If the distance is reduced to less than 15cm, the buzzer outputs a warning sound every 1 second. A warning lamp warning the driver lights up blue.
(3) At this time, the auxiliary light at the rear of the kickboard is turned on so that the rear vehicle can recognize the kickboard driver.
(4) If the distance is reduced to less than 10cm, the buzzer outputs a warning sound every 0.5 seconds. A warning lamp warning the driver lights up a yellow.
(5) If the distance is reduced to less than 5cm, the buzzer outputs a warning sound every 0.3 seconds. A warning lamp warning the driver lights up a red.
(6) If the distance is more than 15cm, the warning sound, warning light, and auxiliary light all return to their original state.
(7) Repeat this process over and over again.
(8) But when you press the switch, the program ends, and when you press it again, the program starts all over again.
Conditions
- The system must be able to be switched on and off using the switch.
- The actual distance value is also printed within 15cm, within 10cm, within 5cm.
- Form is free, but programs programmed in Python should be able to run through Raspberry Pie.
It's even better if you have a circuit diagram with Raspberry Pie.
Please attach the results through Raspberry Pie.
Please explain it in as much detail as possible.
Cambridge International AS & A Level Computer Science
ISBN: 9781510457591
1st Edition
Authors: David Watson, Helen Williams