HoCity Final 02

Video How it works

[ Project Execution Brief ]
A. Data input
from the natural environment: http://www.wunderground.com/weather/api/d/documentation.html
B. Output visualization: City bubbles
Bigger and higher = hotter.
Shows city, country, and temperature
C. Physical input : Proximity sensor- LVEZ0

[ CODE ]
a. Initial Arduino code for proximity sensor

b. Code to upload before moving to processing

c. processing sketch


This slideshow requires JavaScript.

HotCity Final 01

Video How it works http://vimeo.com/33693164

[ Project Execution Brief ]
A. Data input
from the natural environment: 
B. Output visualization: City bubbles
Hotter, bigger and higher. Shows city, country, and temperature
C. Physical input : Potentiometer: cycles the bubbles for information

a. Initial code i used to work with pontentiameter  in Arduino

b. Arduino code i upload before i moved to processing

c. Processing sketch


This slideshow requires JavaScript.

interacting with proximity sensor

This slideshow requires JavaScript.

I’ll say it is Hotcity version 2 to try out interacting with proximity sensor. If user comes closer bubbles would start emerge and the speed of bubble is defined by distance. If use comes closer, the bubbles move faster. Also user can hover mouse to see the information of the bubbles including city, country, and current temperature.

[resource] Studying: to read multiple analog inputs
* http://sheepdogguides.com/arduino/aht1a.htm

Link |Read data from the multiple Serial Ports

I am looking for how to get data from both analog0 and analog1. I found information as below at processing.org. But so far it’s not working well.


import processing.serial.*;

Serial[] myPorts = new Serial[2];  // Create a list of objects from Serial class
int[] dataIn = new int[2];         // a list to hold data from the serial ports

void setup()  {
  size(400, 300);
  // print a list of the serial ports:

// get the ports' names:
  String portOne = Serial.list()[0];
  String portTwo = Serial.list()[1];
  // open the ports:
  myPorts[0] = new Serial(this, portOne, 9600);
  myPorts[1] = new Serial(this, portTwo, 9600);

void draw() {
  // clear the screen:
  // use the latest byte from port 0 for the first circle
  ellipse(width/3, height/2, 40, 40);
    // use the latest byte from port 1 for the second circle
  ellipse(2*width/3, height/2, 40, 40);

void serialEvent(Serial thisPort) {
  // variable to hold the number of the port:
  int portNumber = -1;

  // iterate over the list of ports opened, and match the
  // one that generated this event:
  for (int p = 0; p < myPorts.length; p++) {
    if (thisPort == myPorts[p]) {
      portNumber = p;
  // read a byte from the port:
  int inByte = thisPort.read();
  // put it in the list that holds the latest data from each port:
  dataIn[portNumber] = inByte;
  // tell us who sent what:
  println("Got " + inByte + " from serial port " + portNumber);

Two Analogs

Now I connected two analogs using breadboard.
In a serial monitor it shows value of both potentiometer and Proximity sensor.

Next  How can I use data from each analog pin? Seems i need separate serial ports for each…!??

A0 = Potentiometer : 5v – Gnd – Analog 0
A1 = Range finder :  5v – Gnd – Analog 1