add motor control#16
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds motor control functionality to the switch tester application. The changes introduce a new motor on/off pin configuration and implement logic to control motor operation during testing cycles.
Key changes:
- Addition of motor control pin definition and GPIO configuration
- Motor activation during the main loop and deactivation when count is finished or reset
- Minor spelling corrections in function names and comments
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Script/pinDescription.py | Adds MOTOR_ON_OFF_PIN constant definition for pin 32 |
| Script/main.py | Implements motor control logic, GPIO initialization for motor pin, and fixes spelling errors |
Comment on lines
193
to
+194
| while True: | ||
| gpio.digitalWrite(MOTOR_ON_OFF_PIN, HIGH) |
There was a problem hiding this comment.
The motor is being turned on every iteration of the main loop. This could cause unnecessary GPIO writes and potential motor wear. Consider moving this outside the loop or adding a state check to only turn on the motor when needed.
Suggested change
| while True: | |
| gpio.digitalWrite(MOTOR_ON_OFF_PIN, HIGH) | |
| motor_is_on = False | |
| while True: | |
| if not motor_is_on: | |
| gpio.digitalWrite(MOTOR_ON_OFF_PIN, HIGH) | |
| motor_is_on = True |
Signed-off-by: Arghya Biswas <arghyabiswas05@gmail.com>
4de2e51 to
3a00107
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.