Code it in MakeCode Maker — image 1 of 1

leds_MakeCode_5.png
details

In this case, the settings go down in four steps, from 500 to 100 to 50 to 0. This makes the light get gradually dimmer.

To control how long the light stays at each level of brightness, there are pause blocks from the LOOPS menu inserted between each piece of code.

Again, you can type in a number, or choose from the drop-down menu. All times are in milliseconds (ms). One second is 1000 ms, so 500 ms is half a second.

Back

Search