fade

You need an arduino board, a led.

ArduBlock program:
04

Arduino using a digital port to generate a PWM signal. the PWM signal turn on and off the led in a very fast speed. The speed is too fast to see it. Thus led controled by PWM or analogWrite() looks dimmer than led controlled by digitalWrite(). So you can control led brightness using analogWrite().

The Theory of PWM/analogWrite() control the duty time of a cycle. the more high output time, the brighter of the led. And vice versa.

4

35,830 total views, 6 views today

Leave a comment