void
loop()\xA0 {
\xA0 // set the brightness
of pin 9:
\xA0 analogWrite(9, brightness);\xA0\xA0\xA0
\xA0
// change the brightness for next time through the loop:
\xA0 brightness = brightness + fadeAmount;
\xA0
// reverse the direction of the fading at the ends of the fade:
\xA0 if (brightness == 0 || brightness == 255) {
\xA0\xA0\xA0 fadeAmount = -fadeAmount ;
\xA0 }\xA0\xA0\xA0\xA0
\xA0 // wait for 30
milliseconds to see the dimming effect\xA0\xA0\xA0
\xA0 delay(30);\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0\xA0
}