Javadoc link

MotorHat4Pi is a motor connected to the AdafruitMotorHat4Pi driver board that can be used on the Raspberry PI. It can drive 4 DC motors ( implemented in mrl ) or two stepper motors ( yet to be implemented ).

https://www.adafruit.com/product/2348

To use the motor you need thee services running on the PI.

1. The RasPi service. http://myrobotlab.org/service/RasPi

2. The AdafruitMotorHat4Pi service. It represents the HAT. http://myrobotlab.org/service/AdafruitMotorHat4Pi

3. One to four of this service. One for each motor.

Example code (from branch develop):
# Start the services needed
raspi = runtime.start("raspi","RasPi")
hat = runtime.start("hat","AdafruitMotorHat4Pi")
m1 = runtime.start("m1","MotorHat4Pi")
# Attach the HAT to i2c bus 1 and address 0x60
hat.attach("raspi","1","0x60")
# Use the M1 motor port and attach the motor to the hat
m1.setMotor("M1")
m1.attach("hat")
# Now everything is wired up and we run a few tests
# Full speed forward
m1.move(1) 
sleep(3)
# half speed forward
m1.move(.5)
sleep(3)
# Move backward at 60% speed
m1.move(-.6)
sleep(3)
# Stop
m1.move(0)
# Now you should be able to use the GUI or a script to control the motor
Example configuration (from branch develop):
!!org.myrobotlab.service.config.MotorHat4PiConfig
axis: null
controller: null
listeners: null
locked: false
mapper:
  clip: true
  inverted: false
  maxIn: 100.0
  maxOut: 100.0
  minIn: -100.0
  minOut: -100.0
motorId: null
peers: null
type: MotorHat4Pi