Categories
PhysicalComputing

midterm further documentation


dustroke from ben yee on Vimeo.





working code:

int irSensor = 0; //analog ir sensor pin
int irValue = 0; //analog ir sensor value
int LED = 7; //standard LED

void setup()
{
Serial.begin(9600);// start serial port at 9600 bps:
pinMode(LED, OUTPUT);
}
void loop()
{
//read analog value from the IR detector
irValue = analogRead(irSensor);
//Serial.println(irValue, DEC); // Print the DEC of sensor
//delay(100); NO DELAY FOR A STROBE
//analogWrite(LED, irValue);
if (irValue > 400) {
digitalWrite(LED, HIGH);
}
else {
digitalWrite(LED, LOW);
}
}

Leave a Reply

Your email address will not be published. Required fields are marked *