public class BrickPi
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static Led |
LED1
Use when the LED 1 need to be controlled
|
static Led |
LED2
Use when the LED 2 need to be controlled
|
static Motor |
MA
Use when a motor is connected on port A to control it
|
static Motor |
MB
Use when a motor is connected on port B to control it
|
static Motor |
MC
Use when a motor is connected on port C to control it
|
static Motor |
MD
Use when a motor is connected on port D to control it
|
static int |
NB_ATMEGA_TARGETS
Number of Atmel chips (AtMega328).
|
static int |
NB_MOTORS_BY_ATMEGA
Number of motors for each AtMega328.
|
static int |
NB_SENSORS_BY_ATMEGA
Number of sensors for each AtMega328.
|
static Sensor |
S1
Use when a sensor is connected on port 1 to control it.
|
static Sensor |
S2
Use when a sensor is connected on port 2 to control it.
|
static Sensor |
S3
Use when a sensor is connected on port 3 to control it.
|
static Sensor |
S4
Use when a sensor is connected on port 4 to control it.
|
Modifier and Type | Method and Description |
---|---|
static void |
commitSettings(java.lang.Runnable transaction)
Convenient method to configure motors and sensors in an atomic fashion.
|
static Motor[] |
getMotors()
Convenient getter for all the motors
|
static Sensor[] |
getSensors()
Convenient getter for all the sensors
|
static void |
start()
Once sensors and motors are configured, this method is used to run the BrickPi.
|
static void |
stop()
Once the program is over, this method should be called to release the
resources properly
|
public static final int NB_ATMEGA_TARGETS
public static final int NB_SENSORS_BY_ATMEGA
public static final int NB_MOTORS_BY_ATMEGA
public static Motor MA
public static Motor MB
public static Motor MC
public static Motor MD
public static Sensor S1
public static Sensor S2
public static Sensor S3
public static Sensor S4
public static final Led LED1
public static final Led LED2
public static void start()
public static void stop()
public static Motor[] getMotors()
public static Sensor[] getSensors()
public static void commitSettings(java.lang.Runnable transaction)
transaction
- the transaction code to execute