public class InfraredSensor
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
IR_CENTER
Constant for id of front sensor
|
static int |
IR_LEFT
Constant for id of left sensor
|
static int |
IR_LINE_LEFT
Constant for id of line left sensor (points to floor)
|
static int |
IR_LINE_RIGHT
Constant for id of line right sensor (points to floor)
|
static int |
IR_RIGHT
Constant for id of right sensor
|
Constructor and Description |
---|
InfraredSensor(int id)
Creates an infrared sensor at given port.
|
Modifier and Type | Method and Description |
---|---|
void |
addInfraredListener(InfraredListener infraredListener)
Registers the given IR listener.
|
int |
getValue()
Checks, if infrared light ist detected.
|
public static int IR_CENTER
public static int IR_LEFT
public static int IR_RIGHT
public static int IR_LINE_LEFT
public static int IR_LINE_RIGHT
public InfraredSensor(int id)
id
- the InfraredSensor identifierpublic int getValue()
public void addInfraredListener(InfraredListener infraredListener)
infraredListener
- the InfraredListener to register.