http://www.flickr.com/photos/arturovidich/sets/72157623347646050/
Thursday, February 4, 2010
lego drag and drop crane
here it is (for ease of navigation, and to save time downloading/uploading). thanks arturo!
Tuesday, March 31, 2009
I figure now's as good a time as any to put up the midterm photos, they range in various stages of completion. I should probably mention that if any of the wires pull out of the breadboard, the whole thing goes nuts. They don't fit on here, or blogger's annoying, or something. so they're here.
I had a 12v LED desk lamp that i really didn't like, so i took it apart and used the led pad for this lab.
the circuit diagram describes using a 1k resistor, but i only had 10k and it worked fine, both with the delay program and the variable light (potentiometer) program:

HBridge lab:
I had no problems with the lab (i did wire the c
hip backwards once, but no harm done) - I don't think i'll have time to implement it in something before wednesday, but here are photos:


Tuesday, February 3, 2009
So the tea sensor works now, and is incredibly useful, as it turns out... i may have to find a way to actually design a real one.
also, Laura and I did the observation exercise in Kimmel, with some interesting (more anthropological than technological) results:
http://itp.nyu.edu/blogs/lc514_pcomp/2009/02/04/observation/
also, Laura and I did the observation exercise in Kimmel, with some interesting (more anthropological than technological) results:
http://itp.nyu.edu/blogs/lc514_pcomp/2009/02/04/observation/
Monday, February 2, 2009
here's a problem:
i got the thermisistor to work with one LED, but i was trying to attach a second, and I can't for the life of me get the second to have any brightness whatsoever. I've set it up in an if/else fashion, and wired the two LED's exactly the same way.
here's the way it's set up with a potentiometer instead of a thermisistor (the yellow LED is just hooked to the analog output of the potentiometer):


and here's the code:
int tempPin = 0; //analog input pin from temperature thing = 0
int tempValue = 0; //value read from the temp
int led = 9; //PWM pin that led is on - (PWM 0 = digpin 9)
int clearPin = 2; //pin the clear led is on
int redPin = 3; //pin the red led is on
int THRESHOLD = 860; //threshold of drinkability
void setup() {
pinMode(clearPin, OUTPUT); //clear led pin is an output pin
//initialize serial communication at 9600 bps:
Serial.begin(9600);
}
void loop() {
tempValue = analogRead(tempPin); //read the temperature value
analogWrite(led, tempValue/4); //PWM the led with temp value (divided by 4 to fit in a byte)
Serial.println(tempValue); //print the temp value back to the program
delay(10); //wait 10 ms before looping
if (tempValue <= THRESHOLD) {
digitalWrite(clearPin, HIGH); //turn on clear led
digitalWrite(redPin, LOW); //turn off red led
}
else {
digitalWrite(clearPin, LOW);
digitalWrite(redPin, HIGH);
}
}
any ideas?
i got the thermisistor to work with one LED, but i was trying to attach a second, and I can't for the life of me get the second to have any brightness whatsoever. I've set it up in an if/else fashion, and wired the two LED's exactly the same way.
here's the way it's set up with a potentiometer instead of a thermisistor (the yellow LED is just hooked to the analog output of the potentiometer):


and here's the code:
int tempPin = 0; //analog input pin from temperature thing = 0
int tempValue = 0; //value read from the temp
int led = 9; //PWM pin that led is on - (PWM 0 = digpin 9)
int clearPin = 2; //pin the clear led is on
int redPin = 3; //pin the red led is on
int THRESHOLD = 860; //threshold of drinkability
void setup() {
pinMode(clearPin, OUTPUT); //clear led pin is an output pin
//initialize serial communication at 9600 bps:
Serial.begin(9600);
}
void loop() {
tempValue = analogRead(tempPin); //read the temperature value
analogWrite(led, tempValue/4); //PWM the led with temp value (divided by 4 to fit in a byte)
Serial.println(tempValue); //print the temp value back to the program
delay(10); //wait 10 ms before looping
if (tempValue <= THRESHOLD) {
digitalWrite(clearPin, HIGH); //turn on clear led
digitalWrite(redPin, LOW); //turn off red led
}
else {
digitalWrite(clearPin, LOW);
digitalWrite(redPin, HIGH);
}
}
any ideas?
I'm trying to create a sensor that will determine whether tea is cool enough to drink - it took a while for me to figure out how to deal with the thermisistor, since it (unlike the potentiometer) only has 2 leads... i.e. i had to do some thinking before i figured out that there's no "data" out, and it's just a resistor that changes.
once i figured it out though, i think everything is going well... i've encased the thing in hot glue, so hopefully the values won't get muddled.
once i figured it out though, i think everything is going well... i've encased the thing in hot glue, so hopefully the values won't get muddled.
Wednesday, January 28, 2009
Unfortunately, I lost my camera cord, so there's no pictures, but essentially I made a sign that connects to a toilet-mounted-switch; when the toilet seat is up, it flashes "caution - not suitable for female use" in red, and when the seat is down, "bathroom OK" in green.
initially, it was pretty seamless, but i ran into some trouble when i wanted to make the red (and only the red) blink. I worked it out, and it all seems to work. I'll bring it in.
here's the code:
//set variables:
int switchPin = 2; // digital input for switch to pin 2
int redledPin = 3; // digital output for red LED to pin 3
int greenledPin = 4; // digital output for green LED to pin 4
int switchState = 0; // the state of the switch (open/off)
void setup() {
pinMode(switchPin, INPUT); //set the switch pin to be input
pinMode(redledPin, OUTPUT); //set the red LED pin to be output
pinMode(greenledPin, OUTPUT); //set the green LED pin to be output
switchState = digitalRead(switchPin); //read the input from the switch
}
void loop() {
if (switchState == 0) {
digitalWrite(greenledPin, HIGH); //green LED high if the switch is open
}
else if (switchState == 1) { //if the switch is on
digitalWrite(greenledPin, LOW); //turns off the green LED
digitalWrite(redledPin, HIGH); //turns on the red LED
delay(750); //wait .75sec
digitalWrite(redledPin, LOW); //turns off red LED
delay(250); //wait .25 secs
}
}
initially, it was pretty seamless, but i ran into some trouble when i wanted to make the red (and only the red) blink. I worked it out, and it all seems to work. I'll bring it in.
here's the code:
//set variables:
int switchPin = 2; // digital input for switch to pin 2
int redledPin = 3; // digital output for red LED to pin 3
int greenledPin = 4; // digital output for green LED to pin 4
int switchState = 0; // the state of the switch (open/off)
void setup() {
pinMode(switchPin, INPUT); //set the switch pin to be input
pinMode(redledPin, OUTPUT); //set the red LED pin to be output
pinMode(greenledPin, OUTPUT); //set the green LED pin to be output
switchState = digitalRead(switchPin); //read the input from the switch
}
void loop() {
if (switchState == 0) {
digitalWrite(greenledPin, HIGH); //green LED high if the switch is open
}
else if (switchState == 1) { //if the switch is on
digitalWrite(greenledPin, LOW); //turns off the green LED
digitalWrite(redledPin, HIGH); //turns on the red LED
delay(750); //wait .75sec
digitalWrite(redledPin, LOW); //turns off red LED
delay(250); //wait .25 secs
}
}
Subscribe to:
Posts (Atom)