Skip to content

add motor control#16

Merged
arghyabi merged 1 commit into
masterfrom
motor_control_added
Aug 10, 2025
Merged

add motor control#16
arghyabi merged 1 commit into
masterfrom
motor_control_added

Conversation

@arghyabi
Copy link
Copy Markdown
Owner

No description provided.

@arghyabi arghyabi requested a review from Copilot August 10, 2025 08:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread Script/main.py
Comment on lines 193 to +194
while True:
gpio.digitalWrite(MOTOR_ON_OFF_PIN, HIGH)
Copy link

Copilot AI Aug 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot uses AI. Check for mistakes.
Signed-off-by: Arghya Biswas <arghyabiswas05@gmail.com>
@arghyabi arghyabi force-pushed the motor_control_added branch from 4de2e51 to 3a00107 Compare August 10, 2025 08:06
@arghyabi arghyabi merged commit de1be46 into master Aug 10, 2025
1 check passed
@arghyabi arghyabi deleted the motor_control_added branch August 10, 2025 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants