Skip to content

Instantly share code, notes, and snippets.

@whitemike889
Forked from makersenses/14.esp32_motor.ino
Created April 26, 2021 15:33
Show Gist options
  • Save whitemike889/9749e26cad118e2490b98d484c0d1ab4 to your computer and use it in GitHub Desktop.
Save whitemike889/9749e26cad118e2490b98d484c0d1ab4 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