Untitled Post

posted Dec 8, 2009, 8:45 AM by Unknown user

Yesterday, before class ended we got the LED bar graph to work correctly, we had a problem with one of the LED' shorting because it was touching itself but we got all that fixed, and this is our new program we wrote- int inPin = 1; // analog 5int val = 0; // where to store info from analog 5int pin9= 9;int pin10 = 10;int pin11 = 11; // output of red ledint pin12 = 12;int pin13 = 13;

void setup() {

Serial.begin(9600);

for(int pin = 9; pin < 13; pin++){pinMode(pin,OUTPUT); }

}

void loop() {

val = analogRead(inPin); // reads in the values from analog 5 and //assigns them to val if(val >= 1){