0

December 2, 2016 AT 12:34 pm

Fade a LED without delay() – use Arduino’s analogWrite and millis()

Bald Engineer gives another brilliant Arduino tutorial, not only courtesy of the code he provides but the section-by-section explanation afterwards will really help even novice Arduino makers understand how the code translates to fading LEDs.

millis

It’s a well-known fact of engineering: LEDs make everything look better. And that means a Fading LED is even better. Using Arduino’s analogWrite(), fading a LED is just a matter of a loop. If you use delay(), you can’t easily add other actions. What can you do? Well, Fading a LED with millis() is pretty simple. Here’s the code to do it and a quick explanation.

Read more.


Check out all the Circuit Playground Episodes! Our new kid’s show and subscribe!

Have an amazing project to share? Join the SHOW-AND-TELL every Wednesday night at 7:30pm ET on Google+ Hangouts.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Learn resistor values with Mho’s Resistance or get the best electronics calculator for engineers “Circuit Playground”Adafruit’s Apps!


Maker Business — Transforming Today’s Bad Jobs into Tomorrow’s Good Jobs

Wearables — Leverage long exposure

Electronics — Why do they call it a breadboard?

Biohacking — Finding the Ideal Glucose Level for a Good Night’s Rest

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at AdafruitDaily.com !



No Comments

No comments yet.

Sorry, the comment form is closed at this time.