Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

explanation of how birghtness works

  • Loading branch information...
commit a537234e103837ad9e9f9535f8a6369ab6240fe9 1 parent 006e3f4
@d6y authored
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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.