Treehopper Java API
io.treehopper.libraries.motors.SeeedGroveI2cMotorDriver Class Reference

Seeed Grove I2c Motor Driver. More...

Classes

enum  MotorSetDirection
 
enum  PrescalerFrequency
 The driver frequency. More...
 
enum  Registers
 

Public Member Functions

 SeeedGroveI2cMotorDriver (I2c i2c, boolean a1, boolean a2, boolean a3, boolean a4)
 Construct a new Seeed Grove I2c Motor Driver, with the address specified by the state of the DIP switches. More...
 
 SeeedGroveI2cMotorDriver (I2c i2c, byte address)
 Construct a new Seeed Grove I2c Motor Driver, with the address specified. More...
 
 SeeedGroveI2cMotorDriver (I2c i2c)
 Construct a new Seeed Grove I2c Motor Driver with the default address. More...
 
double getMotor1 ()
 Get the speed – from -1.0 to 1.0 – of Motor 1. More...
 
void setMotor1 (double motor1)
 Set the speed – from -1.0 to 1.0 – of Motor 1. More...
 
double getMotor2 ()
 Get the speed – from -1.0 to 1.0 – of Motor 2. More...
 
void setMotor2 (double motor2)
 Set the speed – from -1.0 to 1.0 – of Motor 2. More...
 
PrescalerFrequency getFrequency ()
 Get the driver frequency. More...
 
void setFrequency (PrescalerFrequency frequency)
 Set the driver frequency. More...
 

Detailed Description

Seeed Grove I2c Motor Driver.

Constructor & Destructor Documentation

◆ SeeedGroveI2cMotorDriver() [1/3]

io.treehopper.libraries.motors.SeeedGroveI2cMotorDriver.SeeedGroveI2cMotorDriver ( I2c  i2c,
boolean  a1,
boolean  a2,
boolean  a3,
boolean  a4 
)

Construct a new Seeed Grove I2c Motor Driver, with the address specified by the state of the DIP switches.

Parameters
i2cthe I2c module the driver is attached to
a1A1
a2A2
a3A3
a4A4

◆ SeeedGroveI2cMotorDriver() [2/3]

io.treehopper.libraries.motors.SeeedGroveI2cMotorDriver.SeeedGroveI2cMotorDriver ( I2c  i2c,
byte  address 
)

Construct a new Seeed Grove I2c Motor Driver, with the address specified.

Parameters
i2cthe I2c module the driver is attached to.
addressthe address of the driver

◆ SeeedGroveI2cMotorDriver() [3/3]

io.treehopper.libraries.motors.SeeedGroveI2cMotorDriver.SeeedGroveI2cMotorDriver ( I2c  i2c)

Construct a new Seeed Grove I2c Motor Driver with the default address.

Parameters
i2cthe I2c module the driver is attached to

Member Function Documentation

◆ getFrequency()

PrescalerFrequency io.treehopper.libraries.motors.SeeedGroveI2cMotorDriver.getFrequency ( )

Get the driver frequency.

Returns
the driver frequency

◆ getMotor1()

double io.treehopper.libraries.motors.SeeedGroveI2cMotorDriver.getMotor1 ( )

Get the speed – from -1.0 to 1.0 – of Motor 1.

Returns
the speed

◆ getMotor2()

double io.treehopper.libraries.motors.SeeedGroveI2cMotorDriver.getMotor2 ( )

Get the speed – from -1.0 to 1.0 – of Motor 2.

Returns
the speed

◆ setFrequency()

void io.treehopper.libraries.motors.SeeedGroveI2cMotorDriver.setFrequency ( PrescalerFrequency  frequency)

Set the driver frequency.

Parameters
frequencythe driver frequency

◆ setMotor1()

void io.treehopper.libraries.motors.SeeedGroveI2cMotorDriver.setMotor1 ( double  motor1)

Set the speed – from -1.0 to 1.0 – of Motor 1.

Parameters
motor1the speed of Motor 1

◆ setMotor2()

void io.treehopper.libraries.motors.SeeedGroveI2cMotorDriver.setMotor2 ( double  motor2)

Set the speed – from -1.0 to 1.0 – of Motor 2.

Parameters
motor2the speed of Motor 2

The documentation for this class was generated from the following file: