1.Electric Clothes Rack
Case Description
The electric clothes rack makes decisions based on the values fed back by the water level/raindrop sensor. When the detected value exceeds a certain threshold, indicating that rain is imminent, it triggers servo control to retract the clothes rack into the balcony.
Key Knowledge Points
Master the usage of the Sugar Water Level/Raindrop module.
Master the usage of the 9g Geekservo servo motor.
Master simple conditional judgment structures.
Case Implementation
Structural Assembly
Circuit Wiring Diagram
- Connect the Sugar water level module to the P1 terminal of the Robotbit Edu.
- Connect the servo's 3-pin wire to the S1 port according to the corresponding colors.
Programming
Usage Notes The 9g servo uses the servo driver on the Robotbit. Therefore, the program must initialize the expansion board at the beginning and set the angle to 90 degrees, which corresponds to the position where the clothes rack is extended outside the balcony.
The water level/soil moisture module returns an analog value, so here we use the [Analog Read] block to judge the threshold. Since the hardware is physically connected to Pin 1, we select Pin 1 from the dropdown menu.