Skip to content

Instantly share code, notes, and snippets.

@seth10
Created January 25, 2017 14:57
Show Gist options
  • Save seth10/f244a66ad9fa130c1acf882dd74f370b to your computer and use it in GitHub Desktop.
Save seth10/f244a66ad9fa130c1acf882dd74f370b to your computer and use it in GitHub Desktop.
go_comeback.ino example modified to just show motorRunSeconds
#include <Wire.h>
#include <EVShield.h>
// setup for this example:
// attach external power to EVShield.
// attach 2 motors to motor ports on Bank A
EVShield evshield(0x34,0x36);
void
setup()
{
evshield.init( SH_HardwareI2C );
//
// reset motors.
//
evshield.bank_a.motorReset();
evshield.bank_b.motorReset();
// Drive forward for 2 seconds, then brake
evshield.bank_a.motorRunSeconds(SH_Motor_Both,
SH_Direction_Reverse,
SH_Speed_Medium,
2,
SH_Completion_Wait_For,
SH_Next_Action_BrakeHold);
delay(1000);
// Drive backwards for 2 seconds, then brake
evshield.bank_a.motorRunSeconds(SH_Motor_Both,
SH_Direction_Forward,
SH_Speed_Medium,
2,
SH_Completion_Wait_For,
SH_Next_Action_BrakeHold);
}
void
loop() // After the setup the LED blinks to show
// the program is complete
{
evshield.ledSetRGB(255,0,0); // light on the EVShield LED
delay(1000); // wait
evshield.ledSetRGB(0,0,0); // turn off the EVShield LED.
delay(1000); // wait
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment