Analog Write PWM an LED with Arduino Nano

Description: Different light levels are shown with an LED when the analog write function is used on a digital PWM pin of the Arduino Nano.

Analog Write PWM with Arduino Nano

Supplies:

1 – Breadboard 830 Points
1 – Arduino Nano
1 – LED
1 – 220 Ohm Resistor

Arduino Code:

int LED = 10;

int time = 1000;

void setup() {

pinMode(LED, OUTPUT);

}

void loop() {

  analogWrite(LED,1);
  delay(time);
  analogWrite(LED,5);
  delay(time);
  analogWrite(LED,15);
  delay(time);
  analogWrite(LED,60);
  delay(time);
  analogWrite(LED,255);
  delay(time);
  analogWrite(LED,60);
  delay(time);
  analogWrite(LED,15);
  delay(time);
  analogWrite(LED,5);
  delay(time);
  analogWrite(LED,1);
  delay(time);
  analogWrite(LED,0);
  delay(time);

}

Leave a Comment

15 − = 11