Wednesday, October 28, 2009
The script that we found here -


http://community.pachube.com/arduino/usb/processing - worked for the feed from Cambridge with ID 0 - temperature. Now we are trying to modify the script to include the humidity, ID 2, from the same feed. We changed the ID of the feed and the pin our LED is connected to, renamed some variables and tweaked the symbols, but still got the error. Here is the script:
import processing.serial.*;
import cc.arduino.*;
import eeml.*;
Arduino arduino;
int myValue;
DataIn dIn;
void setup()
{
size(255,255);
println(Arduino.list());
arduino = new Arduino(this, Arduino.list()[1], 115200);
dIn = new DataIn(this,"http://www.pachube.com/api/feeds/1816.xml", "cb5ac556b416f518567ee5dfec0d9af7cad7a444b52e5e662e796205ca63f7f7", 5000);
}
void temperature()
{
println(myValue);
arduino.analogWrite(9,myValue);
}
void onReceiveEEML(DataIn d){
float remoteValue = d.getValue(0);
myValue = int(remoteValue) / 300;
}
void humidity()
{
println(myValue);
arduino.analogWrite(10,myValue);
}
void onReceiveEEML(DataIn d){
float remoteValue = d.getValue(2);
myValue = int(remoteValue) / 300;
}
And the picture of the wiring and the error message:

Team k.a.a.s.
Labels: K.A.A.S., Living Architecture, Pratt, Responsive Architecture
Post a Comment