orchestracities / lego-diorama-usi-2022

This repository hosts code, configuration and documentation to deploy Orchestra Cities lego diorama.
Apache License 2.0
0 stars 0 forks source link

10 parking raspberrypi #23

Closed Solargi closed 1 year ago

Solargi commented 1 year ago

implemented the following feartures: when sensor detect something (proximity) send message parking spot occupied turn on red light (closed loop) when sensor detect nothing send message parking spot free turn on green light (closed loop)

the variable car_detection_distance used to set a distance from which the car is considered detected must be adjusted when assembling the lego city, there is also a sleep(2) which is used just to avoid overloading the public mqtt server, in order to avoid a possible ban. the sleep command can be changed and/or removed when using the private mqtt broker. the message parking spot occupied is published as an attribute of the proximity sensor, the name of the attribute is: parking_spot_status and the value are either "free" or "occupied". the led are controlled by the raspberry entirely.

a config.ini file has also been defined