Commit | Line | Data |
---|---|---|
a3a3e374 H |
1 | // Fading LED |
2 | // by BARRAGAN <http://people.interaction-ivrea.it/h.barragan> | |
3 | ||
4 | int ledpin = 11; // light connected to digital pin 9 | |
5 | ||
6 | void setup() | |
7 | { | |
8 | pinMode(ledpin, OUTPUT); | |
9 | } | |
10 | ||
11 | void loop() | |
12 | { | |
13 | analogWrite(ledpin, analogRead(0)); // sets the value (range from 0 to 255) | |
14 | } |