(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


Tom Fall 11 Week 4

Syllabus Main? Labs & tutorials Books and Readings Parts & Supplies ClassPages


// put the analog output pins in an array:
int pwmPins[] = {
  3,5,6,9,10,11};

void setup() {

}


void loop() {
  // count from 0 to 5:
  for (int thisPin = 0; thisPin < 6; thisPin++) {
    // read the analog input corresponding to thisPin:
    int sensorValue = analogRead(thisPin);  
    // write to the analog output pin corresponding to thisPin in the array:
    analogWrite(pwmPins[thisPin], sensorValue/4);
  }
}
 
  Edit | View | History | Print | Recent Changes | Search Page last modified on September 28, 2011, at 11:40 AM