Created
December 14, 2013 08:52
-
-
Save e-Gizmo/7957036 to your computer and use it in GitHub Desktop.
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
// Library by Dan, e-Gizmo Mechatronix Central | |
// The library is made to simplify HBridge control | |
// and pwm frequency setting | |
/* | |
Available commands: | |
HBridge variable(wd_pin,pwm_pin,dir_pin); // Assigns pin | |
variable.begin(); // Sets wd pin | |
variable.Forward(speed); // Forward | |
variable.Backward(speed); // Backward | |
variable.Stop(); // Stop | |
*/ | |
#include <HBridge.h> | |
HBridge motors(11,6,8); | |
// This is according to the sample application in the hardware manual | |
void setup() | |
{ | |
motors.begin(); | |
} | |
void loop() | |
{ | |
motors.Forward(255); | |
delay(1000); | |
motors.Backward(255); | |
delay(1000); | |
motors.Stop(); | |
delay(1000); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment