Skip to content

Instantly share code, notes, and snippets.

@e-Gizmo
Created December 14, 2013 08:52
Show Gist options
  • Save e-Gizmo/7957036 to your computer and use it in GitHub Desktop.
Save e-Gizmo/7957036 to your computer and use it in GitHub Desktop.
// 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