Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Hack star
Published © MIT

LED Pulsing - Sinusoidal - Arduino UNO Simulator Project

Wokwi Arduino Simulator is used to drive an LED in a pulsing fashion. Sine wave knowledge is used to create a beautiful pattern.

BeginnerProtip1 hour2,184

Things used in this project

Story

Read more

Schematics

Wokwi Arduino Simulator - Pulsing Pattern for LEDs

Code

Wokwi Arduino Simulator - Pulse Pattern for LEDs

Arduino
const int LED = 11;

void setup()
{
}

void loop()
{
  float in, out;
  
  for (in = 0; in < 6.283; in = in + 0.001)
  {
    out = sin(in) * 127.5 + 127.5;
    analogWrite(LED,out);
  }
}

Credits

Hack star
75 projects • 141 followers
an Arduino enthusiast and an electronic hobbyist
Contact

Comments

Please log in or sign up to comment.