Wednesday, November 4, 2009

Prototype #6


GOAL: Create a circuit that would change intensity of the LED light depending on the specific conditions.

PROCESS: Created a simple circuit with 100 OM resistor and a one color LED.

RESULT: Although it is hard to see, the LED changes the intensity of the light. When running the script, the output numbers vary by 1 to 3 numbers, which is insignificant and therefore does not produce clearly noticeable change in light intensity.

CODE:

import processing.serial.*;
import cc.arduino.*;

import eeml.*;

Arduino arduino;
int myValue;

DataIn dIn;

void setup()
{
size(255,255);
println(Arduino.list());
arduino = new Arduino(this, Arduino.list()[1], 115200);
dIn = new DataIn(this,"http://www.pachube.com/api/feeds/536.xml", "cb5ac556b416f518567ee5dfec0d9af7cad7a444b52e5e662e796205ca63f7f7", 5000);
}

void draw()
{
println(myValue);
arduino.analogWrite(10,myValue);
}

void onReceiveEEML(DataIn d){
float remoteValue = d.getValue(0);
myValue = int(remoteValue) / 1;
}

SOURCE:

Labels: , , ,


Comments:

Post a Comment





<< Home

This page is powered by Blogger. Isn't yours?