EasyManuals Logo

Adafruit Feather M4 Express User Manual

Adafruit Feather M4 Express
178 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #42 background imageLoading...
Page #42 background image
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 Editing Code (https://adafru.it/id3) section below.
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
Open your editor, and create a new file. If you are using
Mu, click the New button in the top left
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 Page 47 of 183

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Adafruit Feather M4 Express and is the answer not in the manual?

Adafruit Feather M4 Express Specifications

General IconGeneral
BrandAdafruit
ModelFeather M4 Express
CategoryMicrocontrollers
LanguageEnglish

Related product manuals