fix motor on off issue on reset#19
Conversation
Signed-off-by: Arghya Biswas <arghya@ialoy.com>
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a motor control issue that occurs during system reset, ensuring the motor is properly restarted after a reset operation. The fix introduces state tracking to prevent LCD display updates during completed cycles and restores motor operation after reset.
- Adds
countCompleteflag to track when counting cycles are finished - Fixes motor control to turn motor back on after reset operations
- Updates pin assignments for various GPIO components
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| config.yaml | Updates application version from 1.9.1.1017 to 1.9.2.1018 |
| Script/singleSwitch.py | Adds countComplete flag, conditionalizes LCD updates, and restores motor control on reset |
| Script/pinDescription.py | Updates GPIO pin assignments for LEDs, reset switch, and other components |
| Script/doubleSwitch.py | Mirrors singleSwitch.py changes with countComplete flag and motor control fix |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| gpio.digitalWrite(MOTOR_ON_OFF_PIN, LOW) | ||
| setMotorControlStatus(LOW) | ||
| lcd.write("Count Finished!", row = ROW_NO_3, padding = True) | ||
| lcd.write("Count Finished!", row = ROW_NO_2, padding = True) |
There was a problem hiding this comment.
The 'Count Finished!' message is now displayed on ROW_NO_2, which conflicts with position status messages that are also displayed on ROW_NO_2. This will overwrite position information and could confuse users about the current state.
| lcd.write("Count Finished!", row = ROW_NO_2, padding = True) | |
| lcd.write("Count Finished!", row = ROW_NO_3, padding = True) |
| gpio.digitalWrite(MOTOR_ON_OFF_PIN, LOW) | ||
| setMotorControlStatus(LOW) | ||
| lcd.write("Count Finished!", row = ROW_NO_3, padding = True) | ||
| lcd.write("Count Finished!", row = ROW_NO_2, padding = True) |
There was a problem hiding this comment.
The 'Count Finished!' message is now displayed on ROW_NO_2, which conflicts with position status messages that are also displayed on ROW_NO_2. This will overwrite position information and could confuse users about the current state.
| lcd.write("Count Finished!", row = ROW_NO_2, padding = True) | |
| lcd.write("Count Finished!", row = ROW_NO_4, padding = True) |
No description provided.