hello,
i using intel galileo gen2 dfrobot motor shield. power , wiring correct still analogwrite not working, , need move wheels backward. cannot use pwm because of conflict causes servo. here sample code not working:
any advice?
i using intel galileo gen2 dfrobot motor shield. power , wiring correct still analogwrite not working, , need move wheels backward. cannot use pwm because of conflict causes servo. here sample code not working:
code: [select]
arduino pll speed control
int e1 = 7;
int m1 = 6;
int e2 = 4;
int m2 = 5;
void setup()
{
pinmode(m1, output);
pinmode(m2, output);
pinmode(e1, output);
pinmode(e2, output);
}
void loop()
{
//move forward woking because of digitalwrite
digitalwrite(e1,high);
digitalwrite(e2, high);
analogwrite(m1, 255);
analogwrite(m2, 255);
delay(30);
//move backward not working because analog not
digitalwrite(e1,high);
digitalwrite(e2, high);
analogwrite(m1, 0);
analogwrite(m2, 0);
delay(30);
}
}
any advice?
analogwrite() value of 255 no different digitalwrite() value of high.
analogwrite() value of 0 no different digitalwrite() value of low.
so, statement wheels not moving backwards because pwm not working nonsense. wheels don't go backwards because standing on brakes.
try novel analogwrite(thepin, 200); wheels given speed turn at.
the digitalwrite()s on enable pins controls direction. analogwrite() controls speed. think can envision 0 going pretty slow.
analogwrite() value of 0 no different digitalwrite() value of low.
so, statement wheels not moving backwards because pwm not working nonsense. wheels don't go backwards because standing on brakes.
try novel analogwrite(thepin, 200); wheels given speed turn at.
the digitalwrite()s on enable pins controls direction. analogwrite() controls speed. think can envision 0 going pretty slow.
Arduino Forum > Using Arduino > Programming Questions > analogWrite not working with PLL
arduino
Comments
Post a Comment