no i dont have any experienced in electric and electronic...the stepper motor im useing is unipolar 6 wires i connect the two com wire to + supply yes im sure the resistor im using is 0.4ohm..........
int motorPin1 = 8;
int motorPin2 = 9;
int motorPin3 = 10;
int motorPin4 = 11;
int delayTime =00.5;
void setup() {
Serial.begin(9600);
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, HIGH);
}
void loop() {
while (Serial.available() == 0);
int val = Serial.read() - '0';
Serial.flush();
if (val == 1) {
int f;
for(f=0;f<=50;f++){
delay(delayTime);
digitalWrite(motorPin1, HIGH);
delay(delayTime);
digitalWrite(motorPin2, LOW);
delay(delayTime);
digitalWrite(motorPin3, LOW);
delay(delayTime);
digitalWrite(motorPin4, LOW);
delay(delayTime);
delay(15);
digitalWrite(motorPin1, LOW);
delay(delayTime);
digitalWrite(motorPin2, HIGH);
delay(delayTime);
digitalWrite(motorPin3, LOW);
delay(delayTime);
digitalWrite(motorPin4, LOW);
delay(delayTime);
delay(15);
digitalWrite(motorPin1, LOW);
delay(delayTime);
digitalWrite(motorPin2, LOW);
delay(delayTime);
digitalWrite(motorPin3, HIGH);
delay(delayTime);
digitalWrite(motorPin4, LOW);
delay(delayTime);
delay(15);
digitalWrite(motorPin1, LOW);
delay(delayTime);
digitalWrite(motorPin2, LOW);
delay(delayTime);
digitalWrite(motorPin3, LOW);
delay(delayTime);
digitalWrite(motorPin4, HIGH);
delay(delayTime);
delay(15);
Serial.flush();
}
}
yes i measure my resistor using multimeter