1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Merge branch 'master' of github.com:arduino/Arduino into LUFA_bootloader

Conflicts:
	build/shared/examples/01.Basics/DigitalReadSerial/DigitalReadSerial.ino
This commit is contained in:
Zach Eveland
2012-04-19 10:34:53 -04:00
5 changed files with 60 additions and 14 deletions

View File

@ -5,19 +5,22 @@
using the analogWrite() function.
This example code is in the public domain.
*/
int led = 9; // the pin that the LED is attached to
int brightness = 0; // how bright the LED is
int fadeAmount = 5; // how many points to fade the LED by
// the setup routine runs once when you press reset:
void setup() {
// declare pin 9 to be an output:
pinMode(9, OUTPUT);
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
// set the brightness of pin 9:
analogWrite(9, brightness);
analogWrite(led, brightness);
// change the brightness for next time through the loop:
brightness = brightness + fadeAmount;
@ -29,3 +32,4 @@ void loop() {
// wait for 30 milliseconds to see the dimming effect
delay(30);
}