Next
I ‘d like to post my sketch on other websites or make it as application. How can i export my file to do so?
i tried ‘export application’, but it didn’t work(does it supposed to work?)
HoCity Final 02
Video How it works
http://vimeo.com/33694138
[ 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
[Process]
HotCity Final 01
Video How it works http://vimeo.com/33693164
[ Project Execution Brief ]
A. Data input from the natural environment: http://www.wunderground.com/weather/api/d/documentation.html
B. Output visualization: City bubbles
Hotter, bigger and higher. Shows city, country, and temperature
C. Physical input : Potentiometer: cycles the bubbles for information
[Code]
a. Initial code i used to work with pontentiameter in Arduino
b. Arduino code i upload before i moved to processing
c. Processing sketch
[Process]
interacting with proximity sensor
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
* http://arduino.cc/en/Tutorial/VirtualColorMixer
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.
http://processing.org/learning/library/serialmultiple.html
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: println(Serial.list()); // 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: background(0); // use the latest byte from port 0 for the first circle fill(dataIn[0]); ellipse(width/3, height/2, 40, 40); // use the latest byte from port 1 for the second circle fill(dataIn[1]); 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); }
proximity sensor working
Now
Basic proximity sensing is working with Arduino sketch.
The value goes small(because it’s like a distance) as user approach to sensor.
Next
Move to processing
Combine with potentiometer
In a serial monitor window above, you can see the numerical value changing based on things around it.
5v- Gnd -Analog 1
suture
I sutured wire to the sensor at school and it’s working.I didn’t need to suture the extra yellow wire at the end but accidentally i did and just leave it like that. Now i cut to prohibit confusion, but i thought it’s better to leave it then force to remove.
Proximity sensor : Range Finder
For sensing the proximity, i am using this LV-maxSonar-EZ0.
* Ultrasonic range finder.
* 2.5V-5.5V, < 3mA
* Outputs: Serial, Analog Voltage & Pulse Width.
It is a size of a dime. The circuit is pretty simple as below. I will suture as picture above and connect with Arduino as below.
This circuit is same as potentiometer, another physical input of my project, so I’ll use bread board to connect both potentiometer and Range finder to 5v-Gnd. I’ll connect potentiometer to analog 2 and LV to analog 1.