CircuitPython Blink Program
Visual Studio Code is the recommended editor for CircuitPython and Python programming in this module.
Download and install Visual Studio Code on your laptop.
Install necessary Visual Studio Code (VS Code) extensions. These include "Python", "Visual Studio IntelliCode" from Microsoft and "CircuitPython". Restart VS Code after installing each extension.

Open CIRCUITPY
directory in VS Code

Copy the following sample code to the code.py
file. Create a code.py
file if doesn't exist
import board
import digitalio
import time
led = digitalio.DigitalInOut(board.LED)
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = True
time.sleep(0.5)
led.value = False
time.sleep(0.5)

Save the code.py
file on your CIRCUITPY
drive. The little LED on the board should now be blinking as soon as you save the file provided that the Feahter board is connected and its name, Adafruit Industries LLC: Feather Bluefruit Sense, appears in the bottom right corner of VSCode.
It is a good idea to save the workspace in CIRCUITPY
drive using File > Save Workspace as
option. You can give any name to the workspace or simply feather-sense.code-workspace
.
References and Acknowledgement
This page is an edited version of Creating and Editing Code published by Kattni Rembor in the Welcome to CircuitPython guide on the Adafruit website.
Last updated