// 2009 mlab.uiah.fi/paja // Experiencing with analogWrite(pulse-wide modulation) command int ledPin = 9; void setup(){ } void loop(){ for(int i = 0; i <= 255; i += 5){ // analogWrite(pin, value); // pin: only pin 9, 10 and 11 supports PWM on Arduino NG // value: 0 - 255 (0 means 0V output. 255 is 5V.) analogWrite(ledPin, i); delay(50); } for(int i = 255; i >= 0; i -= 5){ analogWrite(ledPin, i); delay(50); } }