Created
April 26, 2021 15:32
-
-
Save makersenses/03db4ae2744453647f6ff41d9ec7bd39 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