Last night I made some wires just to show that 1) my idea does work, and 2) and secondly I want to stop people nicking my wooly things. I was origianally planning on the wooly things reacting the the RFID reader, but as they run on the same serial port channel there seems to be some interference going on. I'm not sure processing can read and write to serial ports simultaneously either. So I'm now using the wires to hook up the fun LEDs and stuff to a power source. The arduino program is a simple one that blinks the LEDs and makes the vibe boards pulse.
Here's me testing a wire I just made using my new arduino board.
Here's everything wired up.
5.6.09
here's
A little quick video to show that my project works, and how it works. It's only a quick little video, I'll be making a more detailed one for my site later, as I want to feature bits of the exhibition.
Filmed and edited by Phil. He took over my computer.
Filmed and edited by Phil. He took over my computer.
4.6.09
lets look at the tech
Because I find it all so interesting.
I've spent a lot of time in the project exploring different possible technologies to use, including hacking wiimotes, Arduino, RFID, and colour tracking. I explored all the different strengths and weaknesses of each tech: colour tracking being pap in low light, and interfered with by similarly coloured objects, wiimotes being temperamental little things and prone to errors in Processing in my experience, Arduino being one of the most appealing technologies I looked into, but all the fun components get a little bit expensive on my budget, and RFID only reading tags, not tracking. I'm now going to look into the uses of the two technologies that I have decided to use, and the potential uses of what I have created using them.
When I first started this project I was quite interested in tracking the users around the space, which still interests me, but as I progressed through the project I found myself becoming more interested in creating a tactile interface, and the technologies that were best to create one were what I ended up using - Arduino and RFID tagging. The RFID tagging allowed me to create physical objects that could be recognized by the computer, allowing the real world to interact with the data in the computer. The Lilypad allowed me to create objects that were not only clever and glowy and wow, but allowed me to create objects that the user wants to pick up and interact with. The knitting also helped with that, people seem to be comfortable with the objects and find them familiar because of the way they are made.
"In of itself, I don't find RFID that exciting. When it's connected to a greater network (e.g. a database, the web, other intelligent devices, etc.) , that's when it can get really interesting." - Doria Fan
Doria fan uses RFID tags to create objects that are imbued with personal histories, without overpowering the object with technology. Her RFID enabled medical history bracelets are still bracelets, the technology does not interfere with the practicality of the object.
The tags inside the medical bracelets contain activate a link to the patients online medical history, making it a beautiful but practical object, containing the wearers personal history.
iTea is another RFID tagging system which uses the internet to bring up data.
Dropping your conference pass in a tea cup scans the internet for data about you. Some information is taken off a social network site, some is googled, allowing the user to see their personal profile made by the internet, whether it's true or false.
To sum it up, the wonderful thing about RFID is that it enables an object to be two different things. It remains the object it was or was intended to be, the bracelet is still a bracelet, the big wooly cloud is still a big wooly cloud, but it allows the object to take on a different aspect as well. It becomes an object that can interface with the digital world, and can bring up data that not only relates to the object, but adds to its meaning.
I've looked into the uses of the Arduino lilypad before, so this bit will be a little bit shorter. Basically, after my experimentation and research in my last project, which focused on the lilypad being a technology to create wearable textiles, I found myself wanting to experiment with it more in a different context. I have researched in toy hacking as part of this project, looking into the creations from the mediamatic workshop, which while were brilliant examples of the toys getting new functionalities, the objects lost some of their identities as toys, what with the wires poking out of them. Granted they were prototypes from a workshop, but I wanted to create objects that were still objects. My little wooly friends were designed to be wired up, and buzzing around around the place and blinding people with ultra bright LEDs, but I wanted them to retain the element of familiarity and softness brought about by creating them by knitting, even before i knew I was going to knit them or reminded myself how to knit. By using the lilypad I was able to make them into "shiny wow wow's", but by using soft circuits was able to keep them as approachable objects.
So then, how could what I have made be used? My program, even there are around a thousand lines in it, is rather simplistic. It gets the feed, matches it up with the RFID tag and spits it out to the screen. And makes some swirly animations. All rather nice but the data it's getting, and the way it gets it could be used in other ways. Some examples are in the RFID examples above, using the technology to personalise objects and drag in data from the internet. The use of the weather data itself lends it to be used with a mapping system like google maps, returning the data to it's geographical context, and reminding people who don't have such a detailed map in there heads of where places are in relation to each other. The weather feed could also be used in conjunction with other feeds, perhaps used with flickr, to create a link between a weather state and the most recent and geographically appropriate geotagged photo uploaded, creating a visual representation of the weather that is more closely related to the data than my swirly graphics.
There are many things it could be used for i suppose, now that I've figured out how to do the simpler parts (getting the feed, getting it to the screen, using RFID tags), I plan to keep exploring the possibilities.
I've spent a lot of time in the project exploring different possible technologies to use, including hacking wiimotes, Arduino, RFID, and colour tracking. I explored all the different strengths and weaknesses of each tech: colour tracking being pap in low light, and interfered with by similarly coloured objects, wiimotes being temperamental little things and prone to errors in Processing in my experience, Arduino being one of the most appealing technologies I looked into, but all the fun components get a little bit expensive on my budget, and RFID only reading tags, not tracking. I'm now going to look into the uses of the two technologies that I have decided to use, and the potential uses of what I have created using them.
When I first started this project I was quite interested in tracking the users around the space, which still interests me, but as I progressed through the project I found myself becoming more interested in creating a tactile interface, and the technologies that were best to create one were what I ended up using - Arduino and RFID tagging. The RFID tagging allowed me to create physical objects that could be recognized by the computer, allowing the real world to interact with the data in the computer. The Lilypad allowed me to create objects that were not only clever and glowy and wow, but allowed me to create objects that the user wants to pick up and interact with. The knitting also helped with that, people seem to be comfortable with the objects and find them familiar because of the way they are made.
"In of itself, I don't find RFID that exciting. When it's connected to a greater network (e.g. a database, the web, other intelligent devices, etc.) , that's when it can get really interesting." - Doria Fan
Doria fan uses RFID tags to create objects that are imbued with personal histories, without overpowering the object with technology. Her RFID enabled medical history bracelets are still bracelets, the technology does not interfere with the practicality of the object.
The tags inside the medical bracelets contain activate a link to the patients online medical history, making it a beautiful but practical object, containing the wearers personal history.
iTea is another RFID tagging system which uses the internet to bring up data.
Dropping your conference pass in a tea cup scans the internet for data about you. Some information is taken off a social network site, some is googled, allowing the user to see their personal profile made by the internet, whether it's true or false.
To sum it up, the wonderful thing about RFID is that it enables an object to be two different things. It remains the object it was or was intended to be, the bracelet is still a bracelet, the big wooly cloud is still a big wooly cloud, but it allows the object to take on a different aspect as well. It becomes an object that can interface with the digital world, and can bring up data that not only relates to the object, but adds to its meaning.
I've looked into the uses of the Arduino lilypad before, so this bit will be a little bit shorter. Basically, after my experimentation and research in my last project, which focused on the lilypad being a technology to create wearable textiles, I found myself wanting to experiment with it more in a different context. I have researched in toy hacking as part of this project, looking into the creations from the mediamatic workshop, which while were brilliant examples of the toys getting new functionalities, the objects lost some of their identities as toys, what with the wires poking out of them. Granted they were prototypes from a workshop, but I wanted to create objects that were still objects. My little wooly friends were designed to be wired up, and buzzing around around the place and blinding people with ultra bright LEDs, but I wanted them to retain the element of familiarity and softness brought about by creating them by knitting, even before i knew I was going to knit them or reminded myself how to knit. By using the lilypad I was able to make them into "shiny wow wow's", but by using soft circuits was able to keep them as approachable objects.
So then, how could what I have made be used? My program, even there are around a thousand lines in it, is rather simplistic. It gets the feed, matches it up with the RFID tag and spits it out to the screen. And makes some swirly animations. All rather nice but the data it's getting, and the way it gets it could be used in other ways. Some examples are in the RFID examples above, using the technology to personalise objects and drag in data from the internet. The use of the weather data itself lends it to be used with a mapping system like google maps, returning the data to it's geographical context, and reminding people who don't have such a detailed map in there heads of where places are in relation to each other. The weather feed could also be used in conjunction with other feeds, perhaps used with flickr, to create a link between a weather state and the most recent and geographically appropriate geotagged photo uploaded, creating a visual representation of the weather that is more closely related to the data than my swirly graphics.
There are many things it could be used for i suppose, now that I've figured out how to do the simpler parts (getting the feed, getting it to the screen, using RFID tags), I plan to keep exploring the possibilities.
Labels:
arduino,
hello floor,
lilypad,
processing,
RFID,
year three
behold
my immense, pretty much final, it works and it looks pretty and that's more than enough for me, code.
but before i bore you with the boring source code, here's some pretty pictures of it working.
Once an RFID enabled wooly (or not) symbol of weather is placed on the the reader, the code looks for weather matching the object, in several different cities. An animation is played representing the weather, and if matching weather is found, the city and state of weather is written to the screen, on top of the animation. If the weather doesn't match the RFID tag, a line stating that the weather isn't happening in that particular city is displayed.
For example, placing the symbol for partially cloudy weather on the reader triggers an animation representing that weather. If the weather is partially cloudy in Leeds, the program will show the phrase "It is partly cloudy in Leeds". If the weather in Leeds isn't cloudy, the program will show "It is not partly cloudy in Leeds".
I did experiment with code that tells you what the weather is like in the city if it doesn't match the symbol. So if it wasn't partly cloudy in Leeds, and was actually sunny, putting the partially cloudy symbol on the RFID reader would show the phrase "it's actually sunny in Leeds". Once I did this code I realised it defeated the whole point of having several different objects. Once one object is placed on the reader there is no incentive to place other objects on the reader, and find out what the weather is actually like in that city.
As you see in the examples above, it does return quite a lot of "it's not whatever in where-ever", but this is actually needed to show that the program is doing something, and that the weather you looked for isn't happening everywhere, or where you are looking.
It's not designed to be a simple way to find out what the weather is. For that there is the news or weather websites. This is simply a playful object designed to show and get people to interact with the data in a different way. To bring it to people in a tactile way that makes them hunt out what the weather is.
// having to run this in Processing 1.0 as the version i have been using
// for the rest of the project (0148) has issues with the delay tag
// Now working pretty much fully!!!
// Displays Animations and Text, and doesn't contradict itself.
// Slightly jittery, need to work on getting the delays right - long enough to read the text but not so long it slows down the animation.
// XML stuff
import simpleML.*;
// visual stuff
import processing.candy.*;
import processing.xml.*; // needed for svgs
float angle;
PFont font;
SVG blob1;
SVG blob2;
SVG blob3;
SVG blob4;
SVG blob5;
SVG bigrain;
SVG bigdrip;
SVG puff1;
SVG puff2;
SVG puff3;
SVG puff4;
SVG puff5;
SVG puff6;
SVG cloud;
SVG cloud2;
SVG sun1;
SVG sun2;
SVG sun3;
SVG sun4;
SVG sun5;
SVG sun6;
SVG sunny;
// Serial stuff
// import the serial library:
import processing.serial.*;
Serial myPort; // the serial port you're using
String tagID = ""; // the string for the tag ID
XMLRequest aberdeen;
XMLRequest aberystwyth;
XMLRequest birmingham;
XMLRequest bristol;
XMLRequest dundee;
XMLRequest leeds;
XMLRequest liverpool;
XMLRequest london;
XMLRequest manchester;
XMLRequest newcastle;
XMLRequest oxford;
XMLRequest reading;
int startTime; //create timer
int counter = 0;
String weather;
String city;
String temp;
String partlycloudy;
void setup() {
size(1500, 800);
frameRate(30);
smooth();
//Visual Stuff
blob1 = new SVG(this, "blob_001.svg");
blob2 = new SVG(this, "blob_002.svg");
blob3 = new SVG(this, "blob_003.svg");
blob4 = new SVG(this, "blob_004.svg");
blob5 = new SVG(this, "blob_005.svg");
bigrain = new SVG(this, "bigrain_003.svg");
bigdrip = new SVG(this, "heavy_002.svg");
puff1 = new SVG(this, "puff_001.svg");
puff2 = new SVG(this, "puff_002.svg");
puff3 = new SVG(this, "puff_003.svg");
puff4 = new SVG(this, "puff_004.svg");
puff5 = new SVG(this, "puff_005.svg");
puff6 = new SVG(this, "puff_006.svg");
cloud = new SVG(this, "bigcloud_003.svg");
cloud2 = new SVG(this, "partiallysun_003.svg");
sun1 = new SVG(this, "sun_001.svg");
sun2 = new SVG(this, "sun_002.svg");
sun3 = new SVG(this, "sun_003.svg");
sun4 = new SVG(this, "sun_004.svg");
sun5 = new SVG(this, "sun_005.svg");
sun6 = new SVG(this, "sun_006.svg");
sunny = new SVG(this, "bigsun_004.svg");
font = loadFont("ArnoPro-Regular-70.vlw");
textFont(font, 48);
// list all the serial ports:
println(Serial.list());
// based on the list of serial ports printed from the
// previous command, change the 0 to your port's number:
String portnum = Serial.list()[0];
// initialize the serial port:
myPort = new Serial(this, portnum, 9600);
// incoming string from reader will have 16 bytes:
myPort.buffer(16);
//create and start up request
aberdeen = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0001&u=c");
aberdeen.makeRequest();
aberystwyth = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0203&u=c");
aberystwyth.makeRequest();
birmingham = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0018&u=c");
birmingham.makeRequest();
bristol = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0025&u=c");
bristol.makeRequest();
dundee = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0045&u=c");
dundee.makeRequest();
leeds = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0078&u=c");
leeds.makeRequest();
liverpool = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0083&u=c");
liverpool.makeRequest();
london = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0085&u=c");
london.makeRequest();
manchester = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0092&u=c");
manchester.makeRequest();
newcastle = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0098&u=c");
newcastle.makeRequest();
oxford = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0106&u=c");
oxford.makeRequest();
reading = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0117&u=c");
reading.makeRequest();
startTime = millis();//more timer stuff
}
void serialEvent(Serial myPort) {
// get the serial input buffer in a string:
String inputString = myPort.readString();
// filter out the tag ID from the string:
tagID = parseString(inputString);
}
String parseString(String thisString) {
String tagString = ""; // string to put the tag ID into
// first character of the input:
char firstChar = thisString.charAt(0);
// last character of the input:
char lastChar = thisString.charAt(thisString.length() -1);
// if the first char is STX (0x02) and the last char
// is ETX (0x03), then put the next ten bytes
// into the tag string:
if ((firstChar == 0x02) && (lastChar == 0x03)) {
tagString = thisString.substring(1, 11);
}
return tagString;
}
void draw() {
background(159, 252, 255);
//every 5 seconds, make new request
int now = millis();
if (now - startTime > 5000) {
aberdeen.makeRequest();
println("1");
}
if (now - startTime > 5000) {
aberystwyth.makeRequest();
println("2");
}
if (now - startTime > 5000) {
birmingham.makeRequest();
println("3");
}
if (now - startTime > 5000) {
bristol.makeRequest();
println("4");
}
if (now - startTime > 5000) {
dundee.makeRequest();
println("5");
}
if (now - startTime > 5000) {
leeds.makeRequest();
println("6");
}
if (now - startTime > 5000) {
liverpool.makeRequest();
println("7");
}
if (now - startTime > 5000) {
london.makeRequest();
println("8");
}
if (now - startTime > 5000) {
manchester.makeRequest();
println("9");
}
if (now - startTime > 5000) {
newcastle.makeRequest();
println("10");
}
if (now - startTime > 5000) {
oxford.makeRequest();
println("11");
}
if (now - startTime > 5000) {
reading.makeRequest();
println("12");
startTime = now;
}
if(tagID.equals("210076572B")) { // LIGHT RAIN --------------------------------------
pushMatrix();
translate(500, 400); // center animation
pushMatrix(); // rain 1 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 50, 50, 80, 80); // placement and size
}
popMatrix();
pushMatrix(); // rain 2 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob3.draw( 150, 150, 90, 90); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob2.draw( 200, 200, 100, 100); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob1.draw( 250, 250, 150, 150); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob4.draw( 300, 300, 200, 200); // placement and size
}
popMatrix();
pushMatrix(); // rain 2 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 400, 400, 250, 250); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob1.draw( 500, 500, 300, 300); // placement and size
}
popMatrix();
bigrain.draw( -200, -200, 400, 400);
if (weather.equals("Light Rain") == true) {
fill(0);
text("it's raining lightly in " + city, 150, 40);
delay(100);
}
if (weather.equals("Light Rain/Wind") == true) {
fill(0);
text("it's raining lightly and a bit windy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Light Rain Shower") == true) {
fill(0);
text("there's a light rain shower in " + city, 150, 40);
delay(100);
}
if (weather.equals("Showers in the Vicinity") == true) {
fill(0);
text("there's some rain showers near " + city, 150, 40);
delay(100);
}
if (weather.equals("Partly Cloudy") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Partly Cloudy/Windy") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Cloudy") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy/Windy") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain/Wind") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Few Showers") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Sunny") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Fair") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Sunny") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
popMatrix();
}
if(tagID.equals("2100764B24")) { // PARTLY CLOUDY --------------------------------------
pushMatrix();
translate(500, 400); // center animation
pushMatrix(); // puff 1 animation
for (int i=0; i<6; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
puff1.draw( 0, 0, 150, 150); // placement and size
}
popMatrix();
pushMatrix(); // puff 2 animation
for (int i=0; i<6; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
puff2.draw( 50, 50, 200, 200); // placement and size
}
popMatrix();
pushMatrix(); // puff 3 animation
for (int i=0; i<6; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
puff3.draw( 150, 150, 300, 300); // placement and size
}
popMatrix();
cloud2.draw( -200, -200, 400, 400);
if (weather.equals("Partly Cloudy") == true) {
fill(0);
text("it is partly cloudy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Partly Cloudy/Windy") == true) {
fill(0);
text("it is partly cloudy and a bit windy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Cloudy") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Moslty Cloudy/windy") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain/Wind") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain Shower") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Showers in the Vicinity") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain/Wind") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Few Showers") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Sunny") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Fair") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Sunny") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
popMatrix();
}
if(tagID.equals("2100766B22")) { // CLOUDY --------------------------------------
pushMatrix();
translate(500, 400); // center animation
pushMatrix(); // puff 1 animation
for (int i=0; i<6; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
puff1.draw( 0, 0, 150, 150); // placement and size
}
popMatrix();
pushMatrix(); // puff 2 animation
for (int i=0; i<6; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
puff2.draw( 50, 50, 200, 200); // placement and size
}
popMatrix();
pushMatrix(); // puff 3 animation
for (int i=0; i<6; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
puff3.draw( 150, 150, 300, 300); // placement and size
}
popMatrix();
cloud.draw( -200, -200, 400, 400);
if (weather.equals("Cloudy") == true) {
fill(0);
text("it's cloudy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Mostly Cloudy") == true) {
fill(0);
text("it's mostly cloudy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Mostly Cloudy/Windy") == true) {
fill(0);
text("it's mostly cloudy and a bit windy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Partly Cloudy") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Partly Cloudy/Windy") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain/Wind") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain Shower") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Showers in the Vicinity") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain/Wind") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Few Showers") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Sunny") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Fair") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Sunny") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
popMatrix();
}
if(tagID.equals("21007643E3")) { // HEAVY RAIN --------------------------------------
pushMatrix();
translate(500, 400); // center animation
pushMatrix(); // rain 1 animation
for (int i=0; i<=8; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob1.draw( 50, 50, 80, 80); // placement and size
}
popMatrix();
pushMatrix(); // rain 2 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 100, 100, 90, 90); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob3.draw( 150, 150, 100, 100); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob4.draw( 200, 200, 150, 150); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob2.draw( 250, 250, 200, 200); // placement and size
}
popMatrix();
pushMatrix(); // rain 2 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 350, 350, 250, 250); // placement and size
}
popMatrix();
bigdrip.draw( -200, -200, 400, 400);
if (weather.equals("Rain") == true) {
fill(0);
text("it's raining in " + city, 40, 40);
delay(100);
}
if (weather.equals("Rain/Wind") == true) {
fill(0);
text("it's raining and a bit windy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Few Showers") == true) {
fill(0);
text("there's some rain showers in " + city, 150, 40);
delay(100);
}
if (weather.equals("Partly Cloudy") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Partly Cloudy/Windy") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Cloudy") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy/Windy") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain/Wind") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain Shower") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Showers in the Vicinity") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Sunny") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Fair") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Sunny") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
popMatrix();
}
if(tagID.equals("21007683C0")) { // SUNNY --------------------------------------
pushMatrix();
translate(500, 400); // center animation
pushMatrix(); // puff 1 animation
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
sun1.draw( 50, 50, 50, 50); // placement and size
}
popMatrix();
pushMatrix(); // puff 2 animation
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
sun2.draw( 100, 100, 100, 100); // placement and size
}
popMatrix();
pushMatrix(); // puff 3 animation
for (int i=0; i<12; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
sun3.draw( 200, 200, 150, 150); // placement and size
}
popMatrix();
pushMatrix(); // puff 3 animation
for (int i=0; i<12; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
sun3.draw( 250, 250, 300, 300); // placement and size
}
popMatrix();
sunny.draw( -200, -200, 400, 400);
if (weather.equals("Sunny") == true) {
fill(0);
text("it's sunny in " + city, 150, 40);
delay(100);
}
if (weather.equals("Fair") == true) {
fill(0);
text("it's fair in " + city, 150, 40);
delay(100);
}
if (weather.equals("Partly Cloudy") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Partly Cloudy/Windy") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Cloudy") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy/Windy") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain/Wind") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain Shower") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Showers in the Vicinity") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain/Wind") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Few Showers") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
popMatrix();
}
}
//when request is complete
void netEvent(XMLRequest ml) {
city = ml.getElementAttributeText("yweather:location", "city");
temp = ml.getElementAttributeText("yweather:condition", "temp");
weather = ml.getElementAttributeText("yweather:condition","text");
}
but before i bore you with the boring source code, here's some pretty pictures of it working.
Once an RFID enabled wooly (or not) symbol of weather is placed on the the reader, the code looks for weather matching the object, in several different cities. An animation is played representing the weather, and if matching weather is found, the city and state of weather is written to the screen, on top of the animation. If the weather doesn't match the RFID tag, a line stating that the weather isn't happening in that particular city is displayed.
For example, placing the symbol for partially cloudy weather on the reader triggers an animation representing that weather. If the weather is partially cloudy in Leeds, the program will show the phrase "It is partly cloudy in Leeds". If the weather in Leeds isn't cloudy, the program will show "It is not partly cloudy in Leeds".
I did experiment with code that tells you what the weather is like in the city if it doesn't match the symbol. So if it wasn't partly cloudy in Leeds, and was actually sunny, putting the partially cloudy symbol on the RFID reader would show the phrase "it's actually sunny in Leeds". Once I did this code I realised it defeated the whole point of having several different objects. Once one object is placed on the reader there is no incentive to place other objects on the reader, and find out what the weather is actually like in that city.
As you see in the examples above, it does return quite a lot of "it's not whatever in where-ever", but this is actually needed to show that the program is doing something, and that the weather you looked for isn't happening everywhere, or where you are looking.
It's not designed to be a simple way to find out what the weather is. For that there is the news or weather websites. This is simply a playful object designed to show and get people to interact with the data in a different way. To bring it to people in a tactile way that makes them hunt out what the weather is.
// having to run this in Processing 1.0 as the version i have been using
// for the rest of the project (0148) has issues with the delay tag
// Now working pretty much fully!!!
// Displays Animations and Text, and doesn't contradict itself.
// Slightly jittery, need to work on getting the delays right - long enough to read the text but not so long it slows down the animation.
// XML stuff
import simpleML.*;
// visual stuff
import processing.candy.*;
import processing.xml.*; // needed for svgs
float angle;
PFont font;
SVG blob1;
SVG blob2;
SVG blob3;
SVG blob4;
SVG blob5;
SVG bigrain;
SVG bigdrip;
SVG puff1;
SVG puff2;
SVG puff3;
SVG puff4;
SVG puff5;
SVG puff6;
SVG cloud;
SVG cloud2;
SVG sun1;
SVG sun2;
SVG sun3;
SVG sun4;
SVG sun5;
SVG sun6;
SVG sunny;
// Serial stuff
// import the serial library:
import processing.serial.*;
Serial myPort; // the serial port you're using
String tagID = ""; // the string for the tag ID
XMLRequest aberdeen;
XMLRequest aberystwyth;
XMLRequest birmingham;
XMLRequest bristol;
XMLRequest dundee;
XMLRequest leeds;
XMLRequest liverpool;
XMLRequest london;
XMLRequest manchester;
XMLRequest newcastle;
XMLRequest oxford;
XMLRequest reading;
int startTime; //create timer
int counter = 0;
String weather;
String city;
String temp;
String partlycloudy;
void setup() {
size(1500, 800);
frameRate(30);
smooth();
//Visual Stuff
blob1 = new SVG(this, "blob_001.svg");
blob2 = new SVG(this, "blob_002.svg");
blob3 = new SVG(this, "blob_003.svg");
blob4 = new SVG(this, "blob_004.svg");
blob5 = new SVG(this, "blob_005.svg");
bigrain = new SVG(this, "bigrain_003.svg");
bigdrip = new SVG(this, "heavy_002.svg");
puff1 = new SVG(this, "puff_001.svg");
puff2 = new SVG(this, "puff_002.svg");
puff3 = new SVG(this, "puff_003.svg");
puff4 = new SVG(this, "puff_004.svg");
puff5 = new SVG(this, "puff_005.svg");
puff6 = new SVG(this, "puff_006.svg");
cloud = new SVG(this, "bigcloud_003.svg");
cloud2 = new SVG(this, "partiallysun_003.svg");
sun1 = new SVG(this, "sun_001.svg");
sun2 = new SVG(this, "sun_002.svg");
sun3 = new SVG(this, "sun_003.svg");
sun4 = new SVG(this, "sun_004.svg");
sun5 = new SVG(this, "sun_005.svg");
sun6 = new SVG(this, "sun_006.svg");
sunny = new SVG(this, "bigsun_004.svg");
font = loadFont("ArnoPro-Regular-70.vlw");
textFont(font, 48);
// list all the serial ports:
println(Serial.list());
// based on the list of serial ports printed from the
// previous command, change the 0 to your port's number:
String portnum = Serial.list()[0];
// initialize the serial port:
myPort = new Serial(this, portnum, 9600);
// incoming string from reader will have 16 bytes:
myPort.buffer(16);
//create and start up request
aberdeen = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0001&u=c");
aberdeen.makeRequest();
aberystwyth = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0203&u=c");
aberystwyth.makeRequest();
birmingham = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0018&u=c");
birmingham.makeRequest();
bristol = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0025&u=c");
bristol.makeRequest();
dundee = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0045&u=c");
dundee.makeRequest();
leeds = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0078&u=c");
leeds.makeRequest();
liverpool = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0083&u=c");
liverpool.makeRequest();
london = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0085&u=c");
london.makeRequest();
manchester = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0092&u=c");
manchester.makeRequest();
newcastle = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0098&u=c");
newcastle.makeRequest();
oxford = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0106&u=c");
oxford.makeRequest();
reading = new XMLRequest(this,"http://weather.yahooapis.com/forecastrss?p=UKXX0117&u=c");
reading.makeRequest();
startTime = millis();//more timer stuff
}
void serialEvent(Serial myPort) {
// get the serial input buffer in a string:
String inputString = myPort.readString();
// filter out the tag ID from the string:
tagID = parseString(inputString);
}
String parseString(String thisString) {
String tagString = ""; // string to put the tag ID into
// first character of the input:
char firstChar = thisString.charAt(0);
// last character of the input:
char lastChar = thisString.charAt(thisString.length() -1);
// if the first char is STX (0x02) and the last char
// is ETX (0x03), then put the next ten bytes
// into the tag string:
if ((firstChar == 0x02) && (lastChar == 0x03)) {
tagString = thisString.substring(1, 11);
}
return tagString;
}
void draw() {
background(159, 252, 255);
//every 5 seconds, make new request
int now = millis();
if (now - startTime > 5000) {
aberdeen.makeRequest();
println("1");
}
if (now - startTime > 5000) {
aberystwyth.makeRequest();
println("2");
}
if (now - startTime > 5000) {
birmingham.makeRequest();
println("3");
}
if (now - startTime > 5000) {
bristol.makeRequest();
println("4");
}
if (now - startTime > 5000) {
dundee.makeRequest();
println("5");
}
if (now - startTime > 5000) {
leeds.makeRequest();
println("6");
}
if (now - startTime > 5000) {
liverpool.makeRequest();
println("7");
}
if (now - startTime > 5000) {
london.makeRequest();
println("8");
}
if (now - startTime > 5000) {
manchester.makeRequest();
println("9");
}
if (now - startTime > 5000) {
newcastle.makeRequest();
println("10");
}
if (now - startTime > 5000) {
oxford.makeRequest();
println("11");
}
if (now - startTime > 5000) {
reading.makeRequest();
println("12");
startTime = now;
}
if(tagID.equals("210076572B")) { // LIGHT RAIN --------------------------------------
pushMatrix();
translate(500, 400); // center animation
pushMatrix(); // rain 1 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 50, 50, 80, 80); // placement and size
}
popMatrix();
pushMatrix(); // rain 2 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob3.draw( 150, 150, 90, 90); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob2.draw( 200, 200, 100, 100); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob1.draw( 250, 250, 150, 150); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob4.draw( 300, 300, 200, 200); // placement and size
}
popMatrix();
pushMatrix(); // rain 2 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 400, 400, 250, 250); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0003; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob1.draw( 500, 500, 300, 300); // placement and size
}
popMatrix();
bigrain.draw( -200, -200, 400, 400);
if (weather.equals("Light Rain") == true) {
fill(0);
text("it's raining lightly in " + city, 150, 40);
delay(100);
}
if (weather.equals("Light Rain/Wind") == true) {
fill(0);
text("it's raining lightly and a bit windy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Light Rain Shower") == true) {
fill(0);
text("there's a light rain shower in " + city, 150, 40);
delay(100);
}
if (weather.equals("Showers in the Vicinity") == true) {
fill(0);
text("there's some rain showers near " + city, 150, 40);
delay(100);
}
if (weather.equals("Partly Cloudy") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Partly Cloudy/Windy") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Cloudy") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy/Windy") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain/Wind") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Few Showers") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Sunny") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Fair") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Sunny") == true) {
fill(0);
text("it's not raining lightly in "+ city, 150, 40 );
delay(100);
}
popMatrix();
}
if(tagID.equals("2100764B24")) { // PARTLY CLOUDY --------------------------------------
pushMatrix();
translate(500, 400); // center animation
pushMatrix(); // puff 1 animation
for (int i=0; i<6; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
puff1.draw( 0, 0, 150, 150); // placement and size
}
popMatrix();
pushMatrix(); // puff 2 animation
for (int i=0; i<6; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
puff2.draw( 50, 50, 200, 200); // placement and size
}
popMatrix();
pushMatrix(); // puff 3 animation
for (int i=0; i<6; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
puff3.draw( 150, 150, 300, 300); // placement and size
}
popMatrix();
cloud2.draw( -200, -200, 400, 400);
if (weather.equals("Partly Cloudy") == true) {
fill(0);
text("it is partly cloudy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Partly Cloudy/Windy") == true) {
fill(0);
text("it is partly cloudy and a bit windy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Cloudy") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Moslty Cloudy/windy") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain/Wind") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain Shower") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Showers in the Vicinity") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain/Wind") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Few Showers") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Sunny") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Fair") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Sunny") == true) {
fill(0);
text("it's not a bit cloudy in "+ city, 150, 40 );
delay(100);
}
popMatrix();
}
if(tagID.equals("2100766B22")) { // CLOUDY --------------------------------------
pushMatrix();
translate(500, 400); // center animation
pushMatrix(); // puff 1 animation
for (int i=0; i<6; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
puff1.draw( 0, 0, 150, 150); // placement and size
}
popMatrix();
pushMatrix(); // puff 2 animation
for (int i=0; i<6; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
puff2.draw( 50, 50, 200, 200); // placement and size
}
popMatrix();
pushMatrix(); // puff 3 animation
for (int i=0; i<6; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
puff3.draw( 150, 150, 300, 300); // placement and size
}
popMatrix();
cloud.draw( -200, -200, 400, 400);
if (weather.equals("Cloudy") == true) {
fill(0);
text("it's cloudy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Mostly Cloudy") == true) {
fill(0);
text("it's mostly cloudy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Mostly Cloudy/Windy") == true) {
fill(0);
text("it's mostly cloudy and a bit windy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Partly Cloudy") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Partly Cloudy/Windy") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain/Wind") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain Shower") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Showers in the Vicinity") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain/Wind") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Few Showers") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Sunny") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Fair") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Sunny") == true) {
fill(0);
text("it's not cloudy in "+ city, 150, 40 );
delay(100);
}
popMatrix();
}
if(tagID.equals("21007643E3")) { // HEAVY RAIN --------------------------------------
pushMatrix();
translate(500, 400); // center animation
pushMatrix(); // rain 1 animation
for (int i=0; i<=8; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob1.draw( 50, 50, 80, 80); // placement and size
}
popMatrix();
pushMatrix(); // rain 2 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 100, 100, 90, 90); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob3.draw( 150, 150, 100, 100); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob4.draw( 200, 200, 150, 150); // placement and size
}
popMatrix();
pushMatrix(); // rain 3 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob2.draw( 250, 250, 200, 200); // placement and size
}
popMatrix();
pushMatrix(); // rain 2 animation
for (int i=0; i<8; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 350, 350, 250, 250); // placement and size
}
popMatrix();
bigdrip.draw( -200, -200, 400, 400);
if (weather.equals("Rain") == true) {
fill(0);
text("it's raining in " + city, 40, 40);
delay(100);
}
if (weather.equals("Rain/Wind") == true) {
fill(0);
text("it's raining and a bit windy in " + city, 150, 40);
delay(100);
}
if (weather.equals("Few Showers") == true) {
fill(0);
text("there's some rain showers in " + city, 150, 40);
delay(100);
}
if (weather.equals("Partly Cloudy") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Partly Cloudy/Windy") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Cloudy") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy/Windy") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain/Wind") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain Shower") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Showers in the Vicinity") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Sunny") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Fair") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Sunny") == true) {
fill(0);
text("it's not raining in "+ city, 150, 40 );
delay(100);
}
popMatrix();
}
if(tagID.equals("21007683C0")) { // SUNNY --------------------------------------
pushMatrix();
translate(500, 400); // center animation
pushMatrix(); // puff 1 animation
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
sun1.draw( 50, 50, 50, 50); // placement and size
}
popMatrix();
pushMatrix(); // puff 2 animation
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
sun2.draw( 100, 100, 100, 100); // placement and size
}
popMatrix();
pushMatrix(); // puff 3 animation
for (int i=0; i<12; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
sun3.draw( 200, 200, 150, 150); // placement and size
}
popMatrix();
pushMatrix(); // puff 3 animation
for (int i=0; i<12; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
sun3.draw( 250, 250, 300, 300); // placement and size
}
popMatrix();
sunny.draw( -200, -200, 400, 400);
if (weather.equals("Sunny") == true) {
fill(0);
text("it's sunny in " + city, 150, 40);
delay(100);
}
if (weather.equals("Fair") == true) {
fill(0);
text("it's fair in " + city, 150, 40);
delay(100);
}
if (weather.equals("Partly Cloudy") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Partly Cloudy/Windy") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Cloudy") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Mostly Cloudy/Windy") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain/Wind") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Light Rain Shower") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Showers in the Vicinity") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Rain/Wind") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
if (weather.equals("Few Showers") == true) {
fill(0);
text("it's not sunny in "+ city, 150, 40 );
delay(100);
}
popMatrix();
}
}
//when request is complete
void netEvent(XMLRequest ml) {
city = ml.getElementAttributeText("yweather:location", "city");
temp = ml.getElementAttributeText("yweather:condition", "temp");
weather = ml.getElementAttributeText("yweather:condition","text");
}
2.6.09
animation
Here's a sneaky peek at my animations:
Clouds are surrounded by cotton wool.
Heavy rain is not very impressed by his amazingly colourful background.
code:
// final heavy rain animation
import processing.candy.*;
import processing.xml.*;
float angle;
SVG blob1;
SVG blob2;
SVG blob3;
SVG blob4;
SVG blob5;
SVG bigdrip;
void setup()
{
size(1500, 800);
frameRate(30);
smooth();
blob1 = new SVG(this, "blob_001.svg");
blob2 = new SVG(this, "blob_002.svg");
blob3 = new SVG(this, "blob_003.svg");
blob4 = new SVG(this, "blob_004.svg");
blob5 = new SVG(this, "blob_005.svg");
bigdrip = new SVG(this, "heavy_002.svg");
}
void draw()
{
background(206, 237, 255);
translate(500, 400); // center animation
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob1.draw( 50, 50, 80, 80); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 100, 100, 90, 90); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob3.draw( 150, 150, 100, 100); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob4.draw( 200, 200, 150, 150); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob2.draw( 250, 250, 200, 200); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 350, 350, 250, 250); // placement and size
}
popMatrix();
bigdrip.draw( -200, -200, 400, 400);
}
Clouds are surrounded by cotton wool.
Heavy rain is not very impressed by his amazingly colourful background.
code:
// final heavy rain animation
import processing.candy.*;
import processing.xml.*;
float angle;
SVG blob1;
SVG blob2;
SVG blob3;
SVG blob4;
SVG blob5;
SVG bigdrip;
void setup()
{
size(1500, 800);
frameRate(30);
smooth();
blob1 = new SVG(this, "blob_001.svg");
blob2 = new SVG(this, "blob_002.svg");
blob3 = new SVG(this, "blob_003.svg");
blob4 = new SVG(this, "blob_004.svg");
blob5 = new SVG(this, "blob_005.svg");
bigdrip = new SVG(this, "heavy_002.svg");
}
void draw()
{
background(206, 237, 255);
translate(500, 400); // center animation
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob1.draw( 50, 50, 80, 80); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 100, 100, 90, 90); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob3.draw( 150, 150, 100, 100); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob4.draw( 200, 200, 150, 150); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob2.draw( 250, 250, 200, 200); // placement and size
}
popMatrix();
pushMatrix();
for (int i=0; i<10; i++) //variable controls how many appear
{
angle += 0.0005; // sets speed
rotate(angle); // rotate it
translate(0, 0); // where it is
blob5.draw( 350, 350, 250, 250); // placement and size
}
popMatrix();
bigdrip.draw( -200, -200, 400, 400);
}
testing everything
I decided to try to use my new shiny Duemilanove to test my little wooly bits, and the not so wooly ones. Turned out to be a lot easier than using the lilypad to test them. Instead of having to spend ages sewing up circuits just to rip them back out. I simply plugged one end into the 5v and one into the ground.
This is the only thing that's faulty beyond squishing it into working! The vibe board in the cloud works, but the little sun doesn't light up. This is a bit annoying as I tested it quite extensively while making it.
Here's another cloud with a vibe board in it, this one works fine, although you can't see it in the photo.
Here's my sun..
and my raindrops...
Now I need to fix my sunny cloud, and hook them up to the lilypad.
This is the only thing that's faulty beyond squishing it into working! The vibe board in the cloud works, but the little sun doesn't light up. This is a bit annoying as I tested it quite extensively while making it.
Here's another cloud with a vibe board in it, this one works fine, although you can't see it in the photo.
Here's my sun..
and my raindrops...
Now I need to fix my sunny cloud, and hook them up to the lilypad.
1.6.09
more making things - sun and raindrops
Whilst melting and being banished from using the internet as E3 was on, I was sewing. Sewing so much my fingers want to bleed. And melting. Mostly melting.
Here is my mister sun all ready to be sewn up with a little connecter attached, ready to be connected up to the lilypad.
And here are my raindrops, I decided to put some LEDs into them, to create some kind of feedback.
Here's the circuit inside them...
And here they are all sewn up and with eyes and everything.
That's all of my little components done, now I just need to finish the code, animation and connect it all up.
Here is my mister sun all ready to be sewn up with a little connecter attached, ready to be connected up to the lilypad.
And here are my raindrops, I decided to put some LEDs into them, to create some kind of feedback.
Here's the circuit inside them...
And here they are all sewn up and with eyes and everything.
That's all of my little components done, now I just need to finish the code, animation and connect it all up.
Subscribe to:
Posts (Atom)