This project is read-only.

Sparkfun Ardubot Kit

This information works for the Sparkfun Ardubot PCB

Shield connections

There are four shield connections H-Bridge-compatible:
  • Two speed pins D5 for motor 1, D9 for motor 2
  • Two direction pins D3 for motor 1, D6 for motor 2

Sample code in C#

HBridge MotorDriver = new HBridge(new Netduino.PWM(Pins.GPIO_PIN_D5), Pins.GPIO_PIN_D3, new Netduino.PWM(Pins.GPIO_PIN_D9), Pins.GPIO_PIN_D6);

// Motor 1 half speed backward
MotorDriver.SetState(HBridge.Motors.Motor1, -50);
// Motor 2 half speed forward
MotorDriver.SetState(HBridge.Motors.Motor2, 50);

// Lets run for 5 seconds
Thread.Sleep(5000);

// Motor 1 full speed backward
MotorDriver.SetState(HBridge.Motors.Motor1, -100);
// Motor 2 full speed forward
MotorDriver.SetState(HBridge.Motors.Motor2, 100);

// Lets run for 5 seconds
Thread.Sleep(5000);

// Stops both motors
MotorDriver.SetState(HBridge.Motors.Motor1, 0);
MotorDriver.SetState(HBridge.Motors.Motor2, 0);

Sample code in VB

' This pin-layout counts for the Sparkfun Ardubot Kit:
Dim MotorDriver As HBridge = New HBridge(new Netduino.PWM(Pins.GPIO_PIN_D5), Pins.GPIO_PIN_D3, new Netduino.PWM(Pins.GPIO_PIN_D9), Pins.GPIO_PIN_D6)

' Motor 1 half speed backward
MotorDriver.SetState(HBridge.Motors.Motor1, -50)
' Motor 2 half speed forward
MotorDriver.SetState(HBridge.Motors.Motor2, 50)

' Lets run for 5 seconds
Thread.Sleep(5000)

' Motor 1 full speed backward
MotorDriver.SetState(HBridge.Motors.Motor1, -100)
' Motor 2 full speed forward
MotorDriver.SetState(HBridge.Motors.Motor2, 100)

' Lets run for 5 seconds
Thread.Sleep(5000)

' Stops both motors
MotorDriver.SetState(HBridge.Motors.Motor1, 0)
MotorDriver.SetState(HBridge.Motors.Motor2, 0)

Last edited Jun 4, 2012 at 9:12 AM by Garrcomm, version 2