Announcements

November 24, 2007
Reading for November 27th, are now posted. Enjoy!

October 2, 2007
To upload your thoughtless acts, create a new assignment page like any other lab. You'll see "Thoughtless Acts" listed as one of the assignment options.

May 24, 2008
This site has been archived and is no longer editable. Stay tuned for the next version, coming in the fall!


Revision of <3 from Thu, 09/27/2007 - 08:30

Project Members: 
Laura Greig

Blinking LED Breadboard

Description

Use the Arduino to monitor your heart noise via LEDs and a Processing display.

Components Used

1 Red LED
1 Blue LED
2x 220 Ohm Resistor
10 kOhm Resistor
1 FSR
2x Potentiometer
1 Plush heart

Arduino Code

int fsrPin = 2;
int pot2Pin = 1;
int pot1Pin = 0;

int rPin = 5;
int bPin = 6;

int fsrByte;
int pot1Byte;
int pot2Byte;

void setup()
{
Serial.begin(9600);
// pinMode(rPin, OUTPUT);
// pinMode(gPin, OUTPUT);
// pinMode(bPin, OUTPUT);
}

void loop()
{
fsrByte = analogRead(fsrPin);
pot1Byte = analogRead(pot1Pin);
pot2Byte = analogRead(pot2Pin);
analogWrite(rPin, pot1Byte/4);
analogWrite(bPin, pot2Byte/4);
delay(fsrByte);
analogWrite(rPin, 0);
analogWrite(bPin, 0);
delay(fsrByte);
// Serial.println("FSR reads:");
// Serial.println(fsrByte);
// Serial.println("pot1 reads:" + " " + pot1Byte); // this syntax doesn't work?

}

Item

heartheartheartheart


Powered by Drupal - Design by Artinet