This example uses the Adafruit’s digitalio package to create a DigitalInOut object.

The LED should blink with on and off times of a half second.

import time
import board
import digitalio

led = digitalio.DigitalInOut(board.IO0)
led.direction = digitalio.Direction.OUTPUT

while True:
    led.value = True
    led.value = False

This guide was first published on Dec 18, 2019. It was last updated on Dec 18, 2019.

This page (GPIO) was last updated on Dec 10, 2019.

Text editor powered by tinymce.