nl.tue.id.creapro.admoveo
Class AdMoVeo

java.lang.Object
  extended by nl.tue.id.creapro.admoveo.AdMoVeo
All Implemented Interfaces:
java.lang.Runnable, Pin, Priority, SensorListener

public class AdMoVeo
extends java.lang.Object
implements SensorListener, java.lang.Runnable, Pin, Priority

Together with the IDuino firmware (an Arduino sketch uploaded to the Arduino board), this class allows you to control the AdMoVeo robot from Processing: Controlling all the actuators (LED's, motors, buzzer etc) and receiving input events from all the sensors (distance sensors, light sensors, sound sensors and line readers etc).


Field Summary
 
Fields inherited from interface nl.tue.id.creapro.admoveo.Pin
BUZZER, DIR_L, DIR_R, DISTANCE_F, DISTANCE_L, DISTANCE_R, ENCODER_L, ENCODER_R, FR, LED_B, LED_G, LED_R, LIGHT_L, LIGHT_R, LINE_L, LINE_R, LR, SOUND_L, SOUND_R, SPEED_L, SPEED_R
 
Fields inherited from interface nl.tue.id.creapro.admoveo.Priority
LATER, NOW
 
Constructor Summary
AdMoVeo(processing.core.PApplet parent, java.lang.String name)
          Create a proxy to an AdMoVeo robot running the IDuino firmware.
 
Method Summary
 void execute(java.lang.String task)
          schedule a task to be executed in a dedicated thread, with a priority of AdMoVeo.LATER.
 void execute(java.lang.String task, int priority)
          schedule a task to be executed in a dedicated thread.
 Arduino getArduino()
          Gets the Arduino object used by this AdMoVeo robot.
 AnalogActuator getBlueLed()
          Gets the reference to the blue LED of the robot.
 AnalogActuator getBuzzer()
          Gets the reference to the buzzer of the robot.
 AnalogSensor getFrontDistanceSensor()
          Gets the reference to the front distance sensor of the robot.
 AnalogActuator getGreenLed()
          Gets the reference to the green LED of the robot.
 AnalogSensor getLeftDistanceSensor()
          Gets the reference to the left distance sensor of the robot.
 AnalogSensor getLeftLightSensor()
          Gets the reference to the left light sensor of the robot.
 AnalogSensor getLeftLineSensor()
          Gets the reference to the left line sensor of the robot.
 Motor getLeftMotor()
          Gets the reference to the left motor of the robot.
 AnalogSensor getLeftSoundSensor()
          Gets the reference to the left sound sensor of the robot.
 AnalogActuator getRedLed()
          Gets the reference to the red LED of the robot.
 AnalogSensor getRightDistanceSensor()
          Gets the reference to the right distance sensor of the robot.
 AnalogSensor getRightLightSensor()
          Gets the reference to the right light sensor of the robot.
 AnalogSensor getRightLineSensor()
          Gets the reference to the right line sensor of the robot.
 Motor getRightMotor()
          Gets the reference to the right motor of the robot.
 AnalogSensor getRightSoundSensor()
          Gets the reference to the right sound sensor of the robot.
 void run()
          Internal function for multi-threading in executing the scheduled tasks.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.tue.id.creapro.admoveo.SensorListener
inputAvailable
 

Constructor Detail

AdMoVeo

public AdMoVeo(processing.core.PApplet parent,
               java.lang.String name)
Create a proxy to an AdMoVeo robot running the IDuino firmware. it uses a default baud rate 57600 to communicate with the robot.

Parameters:
parent - the Processing sketch creating this AdMoVeo robot (i.e. "this").
name - the name of the serial device associated with the AdMoVeo robot.
Method Detail

execute

public void execute(java.lang.String task)
schedule a task to be executed in a dedicated thread, with a priority of AdMoVeo.LATER.

Parameters:
task - task the name of the callback function;

execute

public void execute(java.lang.String task,
                    int priority)
schedule a task to be executed in a dedicated thread.

Parameters:
task - the name of the callback function;
priority - the priority of the task. either AdMoVeo.NOW, or AdMoVeo.LATER. Tasks with the priority AdMoVeo.LATER will not be executed until all the AdMoVeo.NOW tasks are executed.

getArduino

public Arduino getArduino()
Gets the Arduino object used by this AdMoVeo robot.

Returns:
the Arduino object.

getBlueLed

public AnalogActuator getBlueLed()
Gets the reference to the blue LED of the robot.

Returns:
the reference to the blue LED.

getBuzzer

public AnalogActuator getBuzzer()
Gets the reference to the buzzer of the robot.

Returns:
the reference to the buzzer.

getFrontDistanceSensor

public AnalogSensor getFrontDistanceSensor()
Gets the reference to the front distance sensor of the robot.

Returns:
the reference to the front distance sensor.

getGreenLed

public AnalogActuator getGreenLed()
Gets the reference to the green LED of the robot.

Returns:
the reference to the green LED.

getLeftDistanceSensor

public AnalogSensor getLeftDistanceSensor()
Gets the reference to the left distance sensor of the robot.

Returns:
the reference to the left distance sensor.

getLeftLightSensor

public AnalogSensor getLeftLightSensor()
Gets the reference to the left light sensor of the robot.

Returns:
the reference to the left light sensor.

getLeftLineSensor

public AnalogSensor getLeftLineSensor()
Gets the reference to the left line sensor of the robot.

Returns:
the reference to the left line sensor.

getLeftMotor

public Motor getLeftMotor()
Gets the reference to the left motor of the robot.

Returns:
the reference to the left motor.

getLeftSoundSensor

public AnalogSensor getLeftSoundSensor()
Gets the reference to the left sound sensor of the robot.

Returns:
the reference to the left sound sensor.

getRedLed

public AnalogActuator getRedLed()
Gets the reference to the red LED of the robot.

Returns:
the reference to the red LED.

getRightDistanceSensor

public AnalogSensor getRightDistanceSensor()
Gets the reference to the right distance sensor of the robot.

Returns:
the reference to the right distance sensor.

getRightLightSensor

public AnalogSensor getRightLightSensor()
Gets the reference to the right light sensor of the robot.

Returns:
the reference to the right light sensor.

getRightLineSensor

public AnalogSensor getRightLineSensor()
Gets the reference to the right line sensor of the robot.

Returns:
the reference to the right line sensor.

getRightMotor

public Motor getRightMotor()
Gets the reference to the right motor of the robot.

Returns:
the reference to the right motor.

getRightSoundSensor

public AnalogSensor getRightSoundSensor()
Gets the reference to the right sound sensor of the robot.

Returns:
the reference to the right sound sensor.

run

public void run()
Internal function for multi-threading in executing the scheduled tasks.

Specified by:
run in interface java.lang.Runnable