Currently using two DAGU Robots DG01D motor with Intel Edison. Had made it worked once but after a few days the motor is not running with no connection changes made. Am sure that the motors are not spoiled. Am i doing something wrong like the programs or the connection?
Thank You.
zaqwerty:
Am i doing something wrong like the programs or the connection?
If you knew nothing at all about your problem and you read your Post would you know how to answer that question?
- Post a link to the datasheet for the motor.
- Post a link to the datasheet for the motor driver.
- Make a pencil drawing showing how everything is connected and post a photo of the drawing.
- Post your program code.
...R
Motor link : 检测中
motor shield link:http://www.elecrow.com/motor-stepper-shield-for-arduino-p-843.html
program :
/*
Stepper Motor Control - one revolution
This program drives a unipolar or bipolar stepper motor.
The motor is attached to digital pins 8 - 11 of the Arduino.
The motor should revolve one revolution in one direction, then
one revolution in the other direction.
Created 11 Mar. 2007
Modified 30 Nov. 2009
by Tom Igoe
*/
#include <Stepper.h>
const int stepsPerRevolution = 200; // change this to fit the number of steps per revolution
// for your motor
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
void setup() {
// set the speed at 60 rpm:
myStepper.setSpeed(60);
// initialize the serial port:
Serial.begin(9600);
}
void loop() {
// step one revolution in one direction:
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
}
Sorry for posting the question above. I got the motor working with program i got from Elecrow website.
Sorry and Thank You for replying
const int pinI1=8;//I1
const int pinI2=11;//I2
const int speedpinA=9;//EA(PWM)to control the motor_1 speed
const int pinI3=12;//I3
const int pinI4=13;//I4
const int speedpinB=10;//EB(PWM]) to control the motor_2 speed
void setup()
{
for(int i=0;i<20;i++)
pinMode(i,OUTPUT); //set to output
}
void loop()
{
Test_Load_Left();
delay(3000);
clean_Output();
delay(1000);
Test_Load_Right();
delay(3000);
}
/Set the motor1 clockwise and motor2 anticlockwise, with speed 150/
void Test_Load_Left()
{
analogWrite(speedpinA,150);
analogWrite(speedpinB,150);
digitalWrite(pinI4,HIGH);
digitalWrite(pinI3,LOW);
digitalWrite(pinI2,HIGH);
digitalWrite(pinI1,LOW);
}
/*Set the motor1 clockwise and motor2 anticlockwise, with speed 100 */
void Test_Load_Right()
{
analogWrite(speedpinA,100);
analogWrite(speedpinB,100);
digitalWrite(pinI1,HIGH);
digitalWrite(pinI2,LOW);
digitalWrite(pinI3,HIGH);
digitalWrite(pinI4,LOW);
}
/*Stop the motors */
void clean_Output()
{
digitalWrite(speedpinA,LOW);// full PWM 255
digitalWrite(speedpinB,LOW);
}
As you have probably figured out now, those are not stepper motors. They are just simple DC motors.
...R