Permalink
Browse files

explanation of how birghtness works

  • Loading branch information...
1 parent 006e3f4 commit a537234e103837ad9e9f9535f8a6369ab6240fe9 @d6y committed Nov 26, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 analog1/analog1.pde
View
6 analog1/analog1.pde
@@ -23,7 +23,7 @@ void setup() {
float darkness = 255; // off
-float delta = 0.05;
+float delta = 0.005;
void loop() {
@@ -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);
}

0 comments on commit a537234

Please sign in to comment.