Script and Tests

Script: led_brightnesses

This script sets a light to ⅛, ¼, ½, and full brightnesses.

  • Change the project name to led_brightnesses.  
  • Update your script to match the one below, then click Save.
  • Click Send to micro:bit.
# led_brightnesses

from microbit import *

while True:
    pin14.write_analog(128)
    sleep(1000)
    pin14.write_analog(256)
    sleep(1000)
    pin14.write_analog(512)
    sleep(1000)
    pin14.write_analog(1023)
    sleep(1000)


Test the LED Brightnesses

  • Look straight down at the top of the LED’s dome, and verify the four different brightnesses.