Last active
March 16, 2018 10:37
-
-
Save iotguider/a2ba029c693bcafb9105b422813bb100 to your computer and use it in GitHub Desktop.
Code for H-Bridge Motor Driver in Arduino
This file contains 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
int input1 = 11; //Number of Motor Input 1 Pin | |
int input2 = 9; //Number of Motor Input 2 Pin | |
void setup() { | |
pinMode(input1, OUTPUT); //Initialize Input 1 Pin | |
pinMode(input2, OUTPUT); //Initialize Input 2 Pin | |
} | |
void loop() { | |
analogWrite(input1, 0); //Write Analog value to Input 1 | |
analogWrite(input2, 255); //Write Analog value to Input 2 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment