/www.elegoo.com //2016.12.12 /************************ Exercise the motor using the L293D chip ************************/ #define ENABLE 5 #define DIRA 3 #define DIRB 4 int i; void setup() { //---set pin direction pinMode(ENABLE,OUTPUT); pinMode(DIRA,OUTPUT); pinMode(DIRB,OUTPUT); Serial.begin(9600); } void loop() { Serial.println("PWM full then slow"); //---PWM example, full speed then slow analogWrite(ENABLE,25); //enable on digitalWrite(DIRA,HIGH); //one way digitalWrite(DIRB,LOW); delay(3000); analogWrite(ENABLE,50); //half speed delay(3000); analogWrite(ENABLE,75); //half speed delay(3000); }