Creating and Editing Code
One of the best things about CircuitPython is how simple it is to get code up and running. In this section, we're going to
cover how to create and edit your first CircuitPython program.
To create and edit code, all you'll need is an editor. There are many options. We strongly recommend using Mu! It's
designed for CircuitPython, and it's really simple and easy to use, with a built in serial console!
If you don't or can't use Mu, there are basic text editors built into every operating system such as Notepad on Windows,
TextEdit on Mac, and gedit on Linux. However, many of these editors don't write back changes immediately to files that
you edit. That can cause problems when using CircuitPython. See the
If you want to skip that section for now, make sure you do "Eject" or "Safe Remove" on Windows or "sync" on Linux
after writing a file if you aren't using Mu. (This is not a problem on MacOS.)
Creating Code
Copy and paste the following code into your editor:
import board
import digitalio
import time
led = digitalio.DigitalInOut(board.D13)
led.direction = digitalio.Direction.OUTPUT
while True:
led.value = True
time.sleep(0.5)
led.value = False
time.sleep(0.5)
© Adafruit Industries
https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51
Editing Code
(https://adafru.it/id3)
Open your editor, and create a new file. If you are using
Mu, click the New button in the top left
section below.
Page 47 of 183
Need help?
Do you have a question about the Feather M4 Express and is the answer not in the manual?