Grumpy_Mike:
So do I but unless you tell us exactly what you are doing then who knows what you are getting wrong.
So schematic, code and photograph all required.
You are right sorry.
/*
Step C0 C1 C2 C3
1 1 0 1 0
2 0 0 1 0
3 0 1 1 0
4 0 1 0 0
5 0 1 0 1
6 0 0 0 1
7 1 0 0 1
8 1 0 0 0
*/
int motorPin1 = 6;//Coil 1
int motorPin2 = 8; //Coil2
int motorPin3 = 7; //Coil3
int motorPin4 = 9; //Coil4
int delayTime = 500;
void setup() {
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);
pinMode(13,OUTPUT);
Serial.begin(9600);
}
int coil1s, coil2s, coil3s, coil4s;
void loop() {
if(Serial.available()==4){
coil1s=Serial.read()-48;
coil2s=Serial.read()-48;
coil3s=Serial.read()-48;
coil4s=Serial.read()-48;
Serial.print(coil1s,DEC);
Serial.print(coil2s,DEC);
Serial.print(coil3s,DEC);
Serial.println(coil4s,DEC);
setcoils(coil1s,coil2s,coil3s,coil4s);
}
/*setcoilds(1,0,0,0);
setcoilds(0,1,0,0);
setcoilds(0,0,1,0);
setcoilds(0,0,0,1); */
}
void setcoils(int coil1,int coil2,int coil3,int coil4){
digitalWrite(motorPin1, coil1);
digitalWrite(motorPin2, coil2);
digitalWrite(motorPin3, coil3);
digitalWrite(motorPin4, coil4);
digitalWrite(13,!digitalRead(13));
delay(delayTime);
}
The Arduino pins are connected to ULN2003 inputs. Motor pins are connected to the ULN2003 outputs.
I checked with multimeter the resistance between the wires and the red one of the motor gave different resistance so i supposed is the common.
I connected the motor common to the ULN2003 common and to external 7V (aprox) powersupply and join the grounds to Arduino.
Now it gets torque with some combinations but I cant find a combination to make it turn.