MotorShield icon indicating copy to clipboard operation
MotorShield copied to clipboard

Using LED's instead of Motor for test purpose

Open Ralfhgw opened this issue 6 years ago • 1 comments

i need some support for the Motor Shield which hardware is installed on Raspi now. According to the first instruction the test script fort he stepper motor is Stepper_Test.py.

Currently i don’t have a motor and want use the LED’s to see the proper functionality of the code. Can you help please to find the right syntax for enabling the LED’s please?

The used Stepper_Test.py looks like:

import PiMotor import time import RPi.GPIO as GPIO

m1 = PiMotor.Stepper("STEPPER1") try: while True: m1.forward(0.1,10) # Delay and rotations time.sleep(2) m1.backward(0.1,10) time.sleep(2) except KeyboardInterrupt: GPIO.cleanup()

Ralfhgw avatar May 25 '19 20:05 Ralfhgw

Hello Ralfhgw,

Yes, you can test the Motor Shield with LED also. But this is a bit difficult to test with a stepper motor program. Because the stepper motor works on 1000 and 1010 logics, so you have to take care of LED connections with Motor Connectors.

Simple connect 5V to motor supply connector and connect LED's with Motor Connectors with resistance (300ohm - 1Kohm)

I hope this will help you to test the stepper motor code with LED's.

Regards, SB Team

sbcshop avatar May 27 '19 10:05 sbcshop