in processing 2.2.1:
import com.temboo.core.*;
import com.temboo.Library.Yahoo.Weather.*;
import processing.serial.*;
Serial port;
int temperature;
// Create a session using your Temboo account application details
TembooSession session = new TembooSession("user", "app", "hash");
void setup() {
runGetTemperatureChoreo();
port = new Serial(this, "COM3", 9600);
}
void runGetTemperatureChoreo() {
GetTemperature getTemperatureChoreo = new GetTemperature(session);
getTemperatureChoreo.setAddress("novorossiysk");
GetTemperatureResultSet getTemperatureResults = getTemperatureChoreo.run();
temperature=int(getTemperatureResults.getTemperature());
temperature = (temperature-32)*5/9;
println(temperature);
println(Serial.list()[1]);
if(temperature==27){
println(port.available());
while (port.available() == 0) {
delay(300);
port.write(65);
}
}
}
After that code i got: 27 (temperature - it`s okay, i convert F to C =) ) And i get error NullPointerException. Arduino is okay, in loop:
if (Serial.available()){ // If data is available to read,
val = Serial.read();
Serial.write(val);
}
can not understand that the hell, now over 3 hours of night, i want to sleep.