Skip to content

Instantly share code, notes, and snippets.

@lancelakey
Created April 6, 2012 17:38
Show Gist options
  • Select an option

  • Save lancelakey/2321570 to your computer and use it in GitHub Desktop.

Select an option

Save lancelakey/2321570 to your computer and use it in GitHub Desktop.
arduino pulse LED
const int LED = 3;
void setup()
{
pinMode(LED, OUTPUT);
}
void loop()
{
for (int i = 0; i<=255; i++)
{
analogWrite(LED,i*i/256);
delay(10);
}
for (int i = 255; i>=0; i--)
{
analogWrite(LED,i*i/256);
delay(10);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment