Assignment 10.1

posted Aug 1, 2010, 10:14 AM by Unknown user   [ updated Aug 1, 2010, 10:24 AM ]
Pretty simple, so I'll just get right to it. Code:
 
 

const int pot1 = 4;
const int led1 = 9;
int brightness;

void setup() {
}

void loop() {
  brightness = map(analogRead(pot1), 0, 1023, 0, 255);
  analogWrite(led1, brightness);
  delay(50);
}
 
 

 
 

Comments