/* Written by R. Jordan Kreindler, 12/2017 Digital pin 3 goes to 3K resistor than to base of TIP120 LED in series with 220 ohm resistor, Both go between TIP120 collector & 5VDC */ int i; // PMW pin 3 #define BASE 3 int delay1 = 1500; void setup() { // Set pin for output to control Base pin pinMode(BASE, OUTPUT); } void loop() { // By changing values for i you can change // the brightness of the LED for (i = 0; i <= 255; i = i + 40) { analogWrite(BASE, i); delay(delay1); } // End for } // End loop