Keyestudio Ks0428 Manual page 136

Table of Contents

Advertisement

www.keyestudio.com
#define ML_Ctrl 13 //define the direction control pin of left motor
#define ML_PWM 11
#define MR_Ctrl 12 //define direction control pin of right motor
#define MR_PWM 3
motor
void setup()
{
pinMode(ML_Ctrl, OUTPUT);//define direction control pin of left
motor as output
pinMode(ML_PWM, OUTPUT);//define PWM control pin of left
motor as output
pinMode(MR_Ctrl, OUTPUT);//define direction control pin of
right motor as output.
pinMode(MR_PWM, OUTPUT);//define the PWM control pin of
right motor as output
}
void loop()
{
digitalWrite(ML_Ctrl,LOW);//set the direction control pin of left
motor to LOW
analogWrite(ML_PWM,200);//set the PWM control speed of left
//define the PWM control pin of left motor
// define the PWM control pin of right
136

Advertisement

Table of Contents
loading

Table of Contents