We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I'm using this so I can turn on a led everytime I get a new mail from gmail but is not working can anyone help or has an idea?
import cc.arduino.*;
import processing.serial.*;
String url;
String lastItem;
Arduino arduino;
int ledPin = 13;
// ************************************************************************************************************************************************************************
void setup() {
url = "https://mail.google.com/mail/feed/atom";
arduino = new Arduino(this, Arduino.list()[0], 57600);
arduino.pinMode(ledPin, Arduino.OUTPUT);
}
void draw() {
XMLElement xml = new XMLElement(this, url);
XMLElement[] titleXMLElements = xml.getChildren("channel/item/title");
String recentItem = titleXMLElements[0].getContent();
if(lastItem == null){
lastItem = recentItem;
}
if (!lastItem.equals(recentItem)) {
println("New item: " + recentItem);
lastItem = recentItem;
arduino.digitalWrite(ledPin, Arduino.HIGH);
delay(100);
arduino.digitalWrite(ledPin, Arduino.LOW);
}
delay(10000);
};
Answers
I'm using this so I can turn on a led everytime I get a new mail from gmail but is not working can anyone help or has an idea?
Formatted code and moved topic: To newcomers in this forum: read attentively these instructions
?
any help?