RoboJDETM v2.0

com.ridgesoft.robotics.effectors
Class DevantechMD03

java.lang.Object
  extended by com.ridgesoft.robotics.effectors.DevantechMD03
All Implemented Interfaces:
Motor

public class DevantechMD03
extends Object
implements Motor

Class to interface with a Devantech MD03 motor driver attached to an I2C port.


Field Summary
 
Fields inherited from interface com.ridgesoft.robotics.Motor
MAX_FORWARD, MAX_REVERSE, STOP
 
Constructor Summary
DevantechMD03(I2CMaster i2cMaster, int deviceAddress)
          Constructs a DevantechMD03 object.
 
Method Summary
 void brake()
          Active braking is not supported.
 int getSoftwareRevision()
          Gets the software revsion of the device's software.
 void setAcceleration(int value)
          Sets the motor controller's acceleration value (see MD03 documentation).
 void setPower(int power)
          Sets the motor's power.
 void stop()
          Turns motor power off and lets them coast.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Constructor Detail

DevantechMD03

public DevantechMD03(I2CMaster i2cMaster,
                     int deviceAddress)
              throws IOException
Constructs a DevantechMD03 object.

Parameters:
i2cMaster - I2C object for the bus the MD03 connects to
deviceAddress - I2C device address of the MD03
Throws:
IOException
Method Detail

brake

public void brake()
Active braking is not supported. This method has the same effect as setPower(0).

Specified by:
brake in interface Motor

getSoftwareRevision

public int getSoftwareRevision()
                        throws IOException
Gets the software revsion of the device's software.

Returns:
software revision number
Throws:
IOException

setAcceleration

public void setAcceleration(int value)
                     throws IOException
Sets the motor controller's acceleration value (see MD03 documentation).

Parameters:
value - acceleration (0 - 255, default 0)
Throws:
IOException

setPower

public void setPower(int power)
Sets the motor's power.

Specified by:
setPower in interface Motor
Parameters:
power - The power level to set. Should be between -16 and 16, inclusive. Positive is forward, negative is reverse and zero is coast.

stop

public void stop()
Turns motor power off and lets them coast. Has the the same effect as setPower(STOP).

Specified by:
stop in interface Motor

RoboJDETM v2.0

Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com