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

Intro.TomFall11Week4 History

Hide minor edits - Show changes to markup

September 28, 2011, at 11:40 AM by ti8 -
Added lines 1-23:

(:source lang=arduino :)

// 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);
  }

}

(:sourceend:)

  Edit | View | History | Print | Recent Changes | Search Page last modified on September 28, 2011, at 11:40 AM