Im switching my setup for my pet feeder to an arduino motorsheild so that my 12v dc motor will work properly (currently my motor doesnt have enough voltage to start sometimes, the torque is to high for just 5v) What all needs to be changed in my code in order to power the motor with the motorsheild?
actually my motorshield came with no instructions except whats written on the back explaining what it does. i have been reading online but i cant figure anything out, my code obviously does not work with the motorshield like it is. i need to power my motor at the full 12v
ive already found the links online and im learing but i still dont know how to implement the functions into my own code which is what i am having trouble with
mbasile:
ive already found the links online and im learing but i still dont know how to implement the functions into my own code which is what i am having trouble with
You can share the links and get help, or you can study them yourself. Your choice.
Found this code, it seems to turn the motor forward and reverse, im currently trying to implement my rtc and my times for feeding (9:30am and 5:30pm) with this code. However, i want the motor to just turn one way (forward) and not alternate.
int lm1 = 8 ;
int lm2 = 11;
int lms = 9;
int rm1 = 12;
int rm2 = 13;
int rms = 10;
void setup()
{
pinMode(lm1,OUTPUT);
pinMode(lm2,OUTPUT);
pinMode(lms,OUTPUT);
pinMode(rm1,OUTPUT);
pinMode(rm2,OUTPUT);
pinMode(rms,OUTPUT);
}
void loop()
{
analogWrite(lms,255);
analogWrite(rms,255);
digitalWrite(lm2,LOW);
digitalWrite(rm2,LOW);
digitalWrite(lm1,HIGH);
digitalWrite(rm1,HIGH);
delay(5000);
digitalWrite(lms,LOW);
digitalWrite(rms,LOW);
delay(2000);
analogWrite(lms,200);
analogWrite(rms,200);
digitalWrite(lm1,LOW);
digitalWrite(rm1,LOW);
digitalWrite(lm2,HIGH);
digitalWrite(rm2,HIGH);
delay(5000);
}
I had to take the lcd off my setup since the motorshield uses the same pins as the lcd, the motor now spins at the correct time however, it will not turn off after the specified 10 seconds......
yhese are some of the links ive been studying from a little bit today, ill try to get some more later once class is over, if it means anything my motorshield is a seeedstudio.