Skip to content

Commit

Permalink
explanation of how birghtness works
Browse files Browse the repository at this point in the history
  • Loading branch information
d6y committed Nov 26, 2011
1 parent 006e3f4 commit a537234
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion analog1/analog1.pde
Expand Up @@ -23,7 +23,7 @@ void setup() {


float darkness = 255; // off
float delta = 0.05;
float delta = 0.005;

void loop() {

Expand All @@ -34,6 +34,10 @@ void loop() {
}

darkness = constrain(darkness, 0, 255);

// PWM = pulse width modulation
// Brightness is really just runng the led on/off 400-ish times a second
// in diffeent proportions for different brightnesses.
analogWrite(GREEN, darkness);

}
Expand Down

0 comments on commit a537234

Please sign in to comment.