Differences between revisions 5 and 6
Revision 5 as of 2008-10-21 08:08:26
Size: 2241
Editor: dyn177231
Comment:
Revision 6 as of 2008-10-21 08:09:45
Size: 2232
Editor: dyn177231
Comment:
Deletions are marked like this. Additions are marked like this.
Line 28: Line 28:
 AnalogSensor getFrontDistanceSensor()::
 
Gets the reference to the front distance sensor of the robot.
 AnalogSensor getFrontDistanceSensor():: Gets the reference to the front distance sensor of the robot.
Line 33: Line 32:
 AnalogSensor getLeftDistanceSensor()::
 
Gets the reference to the left distance sensor of the robot.
 AnalogSensor getLeftDistanceSensor():: Gets the reference to the left distance sensor of the robot.
Line 38: Line 36:
 AnalogSensor getRightDistanceSensor()::
 
Gets the reference to the right distance sensor of the robot.
 AnalogSensor getRightDistanceSensor():: Gets the reference to the right distance sensor of the robot.

  • /!\ 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)