14
Frequence: the prescale frequency of PWM
6. void MotorDirectionSet(unsigned char Direction)
Description: Adjust the direction of the motors
Direction:can be Forward/Reverse rotating.
Usage:
MotorDirectionSet
(
0b1010
);
//"0b1010" defines the output polarity, "10" means the //M+ is "positive"
while the M- is "negative"
// make sure M+ and M- is different polarity when driving DC motors.
delay
(
1000
);
MotorDirectionSet
(
0b0101
);
//0b0101 Rotating in the opposite direction
delay
(
500
)
7. void MotorDriectionAndSpeedSet(unsigned char Direction,unsigned char MotorSpeedA,unsigned
char MotorSpeedB)
Description: Adjust the direction and speed altogether.