hi, i followed this tutorial to control 12V DC motor. Arduino Playground - HomePage
Although it is for solenoid control, i thought the basic principle of controlling is same. so i applied it to motor control and it worked fine when i connected it to another arduino which has been uploaded with blinking LED sketch--http://www.arduino.cc/en/Tutorial/Blink
the motor was slowly rotating when digital pin #13 isn't blinking and rotated fast when it's blinking.
Questino 1) why the motor gets slowly rotated even though the digital pin is not in a HIGH state?
Is this because of the current the motor draws from the power supply?
Also, i tried to control the motor differently. This time, using conditional statements.
void loop(){
val = analogRead(0);
if (val > 1 && < 20)
{
digitalWrite(3, HIGH);
delay(1000);
digitalWrite(3, LOW);
delay(1000);
}
else if (val < 30) {
digitalWrite(5, HIGH);
delay(1000);
digitalWrite(5, LOW);
delay(1000);
}
when those conditions meet, the arduino which has this sketch uploaded makes another arduino's digital pin 13 get HIGH. So, this time, those two arduinos have conditional statements in their program. But, the motor rotates fast when the digital pin #13 is in a LOW state and rotates slowly when the pin is in a HIGH state.
so, it's the opposite situation. i want the motor not to be rotated when the input pin is in a LOW state and rotated when it is in a HIGH state.
i made the hardware connections like this.
can anyone advise me what's the reason?