Differences between revisions 5 and 7 (spanning 2 versions)
Revision 5 as of 2008-10-21 08:08:26
Size: 2241
Editor: dyn177231
Comment:
Revision 7 as of 2008-10-21 08:10:29
Size: 2202
Editor: dyn177231
Comment:
Deletions are marked like this. Additions are marked like this.
Line 14: Line 14:
 AdMoVeo(PApplet parent, String name)::
         
Create a proxy to an AdMoVeo robot running the IDuino firmware. it uses a default baud rate of 57600 to communicate with the robot.
 AdMoVeo(PApplet parent, String name):: Create a proxy to an AdMoVeo robot running the IDuino firmware. it uses a default baud rate of 57600 to communicate with the robot.
Line 21: Line 20:
 getArduino()::
 
Gets the Arduino object used by this AdMoVeo robot.
  Returns::
  
the Arduino object.
 getArduino():: Gets the Arduino object used by this AdMoVeo robot.
  Returns:: the Arduino object.
Line 28: Line 25:
 AnalogSensor getFrontDistanceSensor()::
 
Gets the reference to the front distance sensor of the robot.
  Returns::
  
the reference to the front distance sensor.
 AnalogSensor getFrontDistanceSensor():: Gets the reference to the front distance sensor of the robot.
  Returns:: the reference to the front distance sensor.
Line 33: Line 28:
 AnalogSensor getLeftDistanceSensor()::
 
Gets the reference to the left distance sensor of the robot.
  Returns::
  
the reference to the left distance sensor.
 AnalogSensor getLeftDistanceSensor():: Gets the reference to the left distance sensor of the robot.
  Returns:: the reference to the left distance sensor.
Line 38: Line 31:
 AnalogSensor getRightDistanceSensor()::
 
Gets the reference to the right distance sensor of the robot.
  Returns::
  
the reference to the right distance sensor.
 AnalogSensor getRightDistanceSensor():: Gets the reference to the right distance sensor of the robot.
  Returns:: the reference to the right distance sensor.

  • /!\ This page is under construction. Before it is completed, Please refer to the javadoc for the time being.

1. AdMoVeo in Processing

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).

1.1. AdMoVeo

1.1.1. Constructor

AdMoVeo(PApplet parent, String name)

Create a proxy to an AdMoVeo robot running the IDuino firmware. it uses a default baud rate of 57600 to communicate with the robot.

parent

the Processing sketch creating this AdMoVeo robot (i.e. "this").

name

the name of the serial device associated with the AdMoVeo robot.

1.1.2. Access to devices

1.1.2.1. Arduino
getArduino()

Gets the Arduino object used by this AdMoVeo robot.

Returns
the Arduino object.

1.1.2.2. Sensors
AnalogSensor getFrontDistanceSensor()
Gets the reference to the front distance sensor of the robot.
Returns
the reference to the front distance sensor.
AnalogSensor getLeftDistanceSensor()
Gets the reference to the left distance sensor of the robot.
Returns
the reference to the left distance sensor.
AnalogSensor getRightDistanceSensor()
Gets the reference to the right distance sensor of the robot.
Returns
the reference to the right distance sensor.

1.1.2.3. Actuators

1.2. Actuators

1.2.1. Motors

1.3. Sensors

1.4. Input event handling

1.5. Example

   1 import processing.serial.*;
   2 import nl.tue.id.creapro.admoveo.*;
   3 
   4 AdMoVeo admoveo;
   5 int bgcolor = 255;
   6 
   7 void setup()
   8 {
   9   admoveo = new AdMoVeo(this, "COM11"); 
  10   admoveo.getLeftDistanceSensor().enable();
  11 }
  12 
  13 void draw()
  14 {
  15   background(0,0,bgcolor);
  16 }
  17 
  18 void inputAvailable(Sensor sensor, int oldValue, int newValue){
  19         if(sensor == admoveo.getLeftDistanceSensor()){
  20         bgcolor = newValue/4;
  21         admoveo.getBlueLed().setPower(bgcolor);
  22     }
  23 }

CreaPro: AdMoVeoInProcessing (last edited 2008-11-24 12:17:39 by JunHu)