-
-
Save whitemike889/9749e26cad118e2490b98d484c0d1ab4 to your computer and use it in GitHub Desktop.
14.esp32_motor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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