Question: code for adafruit Led is D13 First, simply fade the LED from off to on in 10% increments using the range function to generate the

code for adafruit

Led is D13

First, simply fade the LED from off to on in 10% increments using the range function to generate the sequence 0 to 100 in increments of 10 (or 0.0 to 1.0 in 0.1 increments). The general structure of what you need to do is shown in the pseudo-code snippet below. Hopefully, youre close to being able to figure out how to do simple things like this on your own, but if youre not, youve got some work to do.

Create LED output object of the appropriate type (class)

# Turn on LED at the specified brightness level

def led_level(level):

set LED duty cycle here doing whatever math you need to scale level properly

while True:

for brightness in range( whatever... ): # fade from off to on

led_level(brightness)

time.sleep( whatever )

for brightness in range( whatever... ): # fade from on to off

led_level(brightness)

time.sleep( whatever... )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!