Skip to content

Instantly share code, notes, and snippets.

@makersenses
Created April 26, 2021 15:32
Show Gist options
  • Save makersenses/03db4ae2744453647f6ff41d9ec7bd39 to your computer and use it in GitHub Desktop.
Save makersenses/03db4ae2744453647f6ff41d9ec7bd39 to your computer and use it in GitHub Desktop.
14.esp32_motor
const int motor_AL = 4;
const int motor_AR = 5;
void setup() {
pinMode(motor_AL, OUTPUT);
pinMode(motor_AR, OUTPUT);
}
void loop() {
// Left
digitalWrite(motor_AL, HIGH);
digitalWrite(motor_AR, LOW);
delay(3000);
// Right
digitalWrite(motor_AL, LOW);
digitalWrite(motor_AR, HIGH);
delay(3000);
//Stop
digitalWrite(motor_AL, LOW);
digitalWrite(motor_AR, LOW);
delay(3000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment