13
7.
Function Reference
1. void SteperStepset(unsigned char stepnu)
Description: Set the steps you want.
stepnu: the Parameter can be 1~255. if 255, the stepper will rotate continuously;
Usage:
Serial
.
println
(
"sent command to + direction,100 steps, fast"
);
SteperStepset
(
100
);
}
2. void StepperMotorEnable(unsigned char Direction, unsigned char motorspeed)
Description: Enable the IIC motor driver to drive a 4-wire stepper.
Direction: Stepper direction 1/0
motorspeed: defines the time interval the i2C motor driver, Change it output to drive the stepper. The actual
interval time is : motorspeed * 4ms. That is , When motor speed is 10, the interval time would be 40 ms.
Usage:
StepperMotorEnable
(
1
,
1
);
// enable the i2c motor driver a stepper.
3. void StepperMotorUnenable()
Description: Uneanble IIC motor drive to drive the stepper.
Usage:
StepperMotorUnenable
();
4. void MotorSpeedSetAB(unsigned char MotorSpeedA , unsigned char MotorSpeedB)
Description: defines the speed of motor 1 and motor 2
MotorSpeedA: the DC motor A speed, should be 0~100;
MotorSpeedB: the DC motor B speed, should be 0~100;
Usage:
Serial
.
println
(
"sent DC speed 100"
);
MotorSpeedSetAB
(
100
,
100
);
//defines the speed of motor 1 and motor 2;
delay
(
10
);
//this delay needed
5. void MotorPWMFrequenceSet(unsigned char Frequence)
Description:set the prescale frequency of PWM, 0x03 default
Содержание Grove I2C Motor Driver
Страница 2: ...2 Document Revision History Revision Date Author Description 1 0 Sep 21 2015 Victor He Create file ...
Страница 9: ...6 5 Application ideas Robots Homebuilt RC cars Case fans High power LED illumination ...
Страница 20: ...17 10 Support If you have questions or other better design ideas you can go to our forum or wish to discuss ...