sbcshop / MotorShield

Designed to help you get your Raspberry Pi based Robot. This board can control DC motor as well as the stepper motor. You can connect your IR and Ultrasonic sensors to tell your robot about its environment. You can easily make your Line Following, Object following, Wall following, Maze-Solver Robots.
https://shop.sb-components.co.uk/products/motorshield-for-raspberry-pi
52 stars 47 forks source link

Using LED's instead of Motor for test purpose #15

Open Ralfhgw opened 5 years ago

Ralfhgw commented 5 years ago

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()

sbcshop commented 5 years ago

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