(edit sidebar)
Intro to Physical Computing Syllabus

Research & Learning

Other Class pages

Shop Admin

ITP Help Pages
Tom's pcomp site
DanO's pcomp site


Week 11

Syllabus Main? Labs & tutorials Books and Readings Parts & Supplies ClassPages
void loop() {
  // read sensors
  // if I get a peak on a sensor, make the light get bright
  // if there's no peak, fade the light until it's out

  while (brightness > 0) {
    analogWrite(pinNumber, brightness);
    brightness--;

    while (millis() - then < delayTime) {
      // wait
      sensorReading = analogRead(A0);
      if (sensorReading /4 > brightness) {  
        brightness = sensorReading /4;
      }
    }
  }
}
  Edit | View | History | Print | Recent Changes | Search Page last modified on November 21, 2012, at 05:11 PM