0

Raspberry Pi 3 stepper motor release
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Raspberry Pi 3 stepper motor release

by Skydromer on Wed Aug 14, 2019 7:47 am

ok i am stupid. i edit the wrong files. Now i think i got the right ones but cant get permission to change them. :/

Skydromer
 
Posts: 23
Joined: Thu Jul 18, 2019 2:56 am

Re: Raspberry Pi 3 stepper motor release

by Skydromer on Wed Aug 14, 2019 9:52 am

I think i got it. The motor wont hold torque anymore.
I just get acesses to the files with
Code: Select all | TOGGLE FULL SIZE
sudo chmode a+w file-name-or-path-here

then wrote my def
Code: Select all | TOGGLE FULL SIZE
def release(self):
                coils = [0, 0, 0, 0]
                self.MC.setPin(self.AIN1, coils[0])
                self.MC.setPin(self.AIN2, coils[0])
                self.MC.setPin(self.BIN1, coils[0])
                self.MC.setPin(self.BIN2, coils[0])
                self.MC._pwm.setPWM(self.PWMA, 0, 0)
                self.MC._pwm.setPWM(self.PWMB, 0, 0) 


then i add to my script:
Code: Select all | TOGGLE FULL SIZE
from Adafruit_MotorHAT.Adafruit_MotorHAT_Motors import Adafruit_MotorHAT, Adafruit_DCMotor, Adafruit_StepperMotor
important is the .Adafruit_MotorHAT_Motors which isnt in the examples.
Code: Select all | TOGGLE FULL SIZE
 myStepper.release()
             myStepper2.release()

it is running.

Skydromer
 
Posts: 23
Joined: Thu Jul 18, 2019 2:56 am

Re: Raspberry Pi 3 stepper motor release

by winecooler5 on Wed Aug 21, 2019 5:28 am

What code are you using to drive stepper motors?

winecooler5
 
Posts: 2
Joined: Tue Aug 20, 2019 7:33 am

Re: Raspberry Pi 3 stepper motor release

by Skydromer on Wed Aug 21, 2019 7:20 am

winecooler5 wrote:What code are you using to drive stepper motors?

Code: Select all | TOGGLE FULL SIZE
def move_right():
     global s
     if GPIO.input(endlage_oben) == GPIO.HIGH:
         myStepper.step(445, Adafruit_MotorHAT.BACKWARD, Adafruit_MotorHAT.SINGLE)
         while GPIO.input(slotschranke) != GPIO.HIGH
                    mySteper.oneStep(Adafruit_MotorHAT.BACKWARD, Adafruit_MotorHAT.INTERLEAVE)
     turnOffMotors()

Skydromer
 
Posts: 23
Joined: Thu Jul 18, 2019 2:56 am

Please be positive and constructive with your questions and comments.