Subscribe RSS

If you want to program the AdMoVeo in Processing, like it is done in Creative Programming for Designers you have to setup the processing  SoftwareEnvironment   as decribed in the assignment description and you have to program the AdMoVeo once with the IDuino firmware. This firmware and the corresponding library’s in Processing allow you to interface with the AdMoVeo trough a serial port and read sensors and set actuators remotely from your PC.

All possibility’s of the software library in Processing is described in AdMoVeo in Processing.

A piece of Processing code that reads out a distance sensor and gives an output in led intensity looks like this:

import processing.serial.*;
import nl.tue.id.creapro.admoveo.*;

AdMoVeo admoveo;
int bgcolor = 255;

void setup()
{
  admoveo = new AdMoVeo(this, "COM5");
  admoveo.getLeftDistanceSensor().enable();
}

void draw()
{
  background(0,0,bgcolor);
}

void inputAvailable(Sensor sensor, int oldValue, int newValue){
    if(sensor == admoveo.getLeftDistanceSensor()){
        admoveo.execute("changeBlueLed", AdMoVeo.NOW);
    }
}

void changeBlueLed(SensorStatus s){
  bgcolor = s.get(admoveo.getLeftDistanceSensor())/4;
  admoveo.getBlueLed().setPower(bgcolor);
}