Fix motor maunall control at night#6
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes motor manual control during night time by modifying the automatic motor control logic and updates valve pin assignments and scheduling.
- Replaces automatic motor shutdown at night with a warning message, allowing manual control
- Changes valve pin assignments from pins 36/37 to pins 11/13
- Adds an afternoon 5PM valve operation schedule in addition to existing morning and evening runs
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Scripts/PinDescription.py | Updates valve pin assignments to new GPIO pins |
| Scripts/Main.py | Modifies night-time motor control logic and adds afternoon valve schedule |
| Scripts/Common.py | Adds AFTERNOON_5PM constant for new valve schedule |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
a145f0d to
bf7c823
Compare
Signed-off-by: Arghya Biswas <arghyabiswas05@gmail.com>
bf7c823 to
bcf75be
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| # Evening valve operation | ||
| if now.hour == EVENING_8PM and not eveningRunDone: | ||
| if now.hour == NIGHT_9PM and not evening9RunDone: |
There was a problem hiding this comment.
The variable name 'evening9RunDone' is inconsistent with the timing. Since this runs at NIGHT_9PM (9 PM), it should be named 'night9RunDone' to match the actual execution time.
| gpio.output(MOTOR_PIN, False) | ||
| motorStatus = "OFF" | ||
| print("Night time: Motor OFF") | ||
| print("Night time: Automatic motor control disabled. Only manual control available!") |
There was a problem hiding this comment.
The motor is not explicitly turned off during night time. The previous logic ensured the motor was turned off with gpio.output(MOTOR_PIN, False), but this line only prints a message. This could leave the motor running automatically during night hours.
| print("Night time: Automatic motor control disabled. Only manual control available!") | |
| print("Night time: Automatic motor control disabled. Only manual control available!") | |
| gpio.output(MOTOR_PIN, False) | |
| motorStatus = "OFF" |
No description provided.