2241
Comment:
|
2232
|
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. |
Contents
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.
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 }