Adafruit Feather M0 Express - Designed for CircuitPython
Created by lady ada
Last updated on 2018-10-28 01:08:07 AM UTC
Guide Contents
Guide Contents
Overview
Pinouts
Power Pins
Logic pins
SPI Flash and NeoPixel
Other Pins!
Debug Interface
Assembly
Header Options!
Soldering in Plain Headers
Prepare the header strip:
Add the breakout board:
And Solder!
2
9
12
12
13
14
14
15
16
16
19
19
20
20
Soldering on Female Header
Tape In Place
Flip & Tack Solder
And Solder!
22
22
23
24
Power Management
Battery + USB Power
Power supplies
Measuring Battery
ENable pin
Arduino IDE Setup
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
26
26
27
27
28
29
30
Using with Arduino IDE
Install SAMD Support
Install Adafruit SAMD
Install Drivers (Windows 7 & 8 Only)
Blink
Successful Upload
Compilation Issues
Manually bootloading
Ubuntu & Linux Issue Fix
Adapting Sketches to M0
Analog References
Pin Outputs & Pullups
Serial vs SerialUSB
AnalogWrite / PWM on Feather/Metro M0
analogWrite() PWM range
Missing header files
© Adafruit Industries
https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-
circuitpython
32
32
32
34
35
36
36
37
37
38
38
38
38
39
40
40
Page 2 of 195
Bootloader Launching
Aligned Memory Access
Floating Point Conversion
How Much RAM Available?
Storing data in FLASH
Pretty-Printing out registers
Using SPI Flash
Read & Write CircuitPython Files
Format Flash Memory
Datalogging Example
Reading and Printing Files
Full Usage Example
Accessing SPI Flash
Feather HELP!
40
40
41
41
41
41
43
43
45
46
47
47
48
50
My ItsyBitsy/Feather stopped working when I unplugged the USB!
50
My Feather never shows up as a COM or Serial port in the Arduino IDE
50
Ack! I "did something" and now when I plug in the Itsy/Feather, it doesn't show up as a device anymore so I cant
upload to it or fix it...
50
I can't get the Itsy/Feather USB device to show up - I get "USB Device Malfunctioning" errors!
51
I'm having problems with COM ports and my Itsy/Feather 32u4/M0
51
I don't understand why the COM port disappears, this does not happen on my Arduino UNO!
52
I'm trying to upload to my 32u4, getting "avrdude: butterfly_recv(): programmer is not responding" errors
52
I'm trying to upload to my Feather M0, and I get this error "Connecting to programmer: .avrdude: butterfly_recv():
programmer is not responding"
52
I'm trying to upload to my Feather and i get this error "avrdude: ser_recv(): programmer is not responding"
52
I attached some wings to my Feather and now I can't read the battery voltage!
52
What is CircuitPython?
CircuitPython is based on Python
Why would I use CircuitPython?
53
53
53
CircuitPython
Set up CircuitPython Quick Start!
Further Information
55
55
57
Installing Mu Editor
Installing Mu for Windows or Mac OS X
58
58
Installing Mu for Linux
Using Mu
Mu Packages
58
58
59
Creating and Editing Code
Creating Code
Editing Code
Your code changes are run as soon as the file is done saving.
60
60
62
62
1. Use an editor that writes out the file completely when you save it.
2. Eject or Sync the Drive After Writing
Oh No I Did Something Wrong and Now The CIRCUITPY Drive Doesn't Show Up!!!
62
63
63
Back to Editing Code...
Exploring Your First CircuitPython Program
© Adafruit Industries
https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-
circuitpython
63
63
Page 3 of 195
Imports & Libraries
Setting Up The LED
Loop-de-loops
64
64
64
More Changes
Naming Your Program File
Connecting to the Serial Console
Are you using Mu?
Using Something Else?
Interacting with the Serial Console
The REPL
Returning to the serial console
CircuitPython Libraries
Installing the CircuitPython Library Bundle
Example Files
Express Boards
Non-Express Boards
Example: ImportError Due to Missing Library
Library Install on Non-Express Boards
Updating CircuitPython Libraries/Examples
65
65
66
66
67
68
71
74
76
76
77
78
78
78
79
80
Troubleshooting
CPLAYBOOT, TRINKETBOOT, FEATHERBOOT, or GEMMABOOT Drive Not Present
You may have a different board.
MakeCode
Windows 10
Windows 7
81
81
81
81
81
81
Windows Explorer Locks Up When Accessing boardnameBOOT Drive
CIRCUITPY Drive Does Not Appear
CircuitPython RGB Status Light
ValueError: Incompatible .mpy file.
CIRCUITPY Drive Issues
Easiest Way: Use storage.erase_filesystem()
Old Way: For the Circuit Playground Express, Feather M0 Express, and Metro M0 Express:
Old Way: For Non-Express Boards with a UF2 bootloader (Gemma M0, Trinket M0):
Old Way: For non-Express Boards without a UF2 bootloader (Feather M0 Basic Proto, Feather Adalogger,
Arduino Zero):
82
82
82
83
83
83
84
84
85
Running Out of File Space on Non-Express Boards
Delete something!
Use tabs
Mac OSX loves to add extra files.
Prevent & Remove Mac OSX Hidden Files
Copy Files on Mac OSX Without Creating Hidden Files
Other Mac OSX Space-Saving Tips
85
85
85
85
86
86
87
Uninstalling CircuitPython
Backup Your Code
89
89
Moving to MakeCode
Moving to Arduino
https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-
circuitpython
89
90
© Adafruit Industries
Page 4 of 195
Welcome to the Community!
Adafruit Discord
Adafruit Forums
Adafruit Github
ReadTheDocs
92
92
93
94
95
CircuitPython Essentials
CircuitPython Built-Ins
Thing That Are Built In and Work
Flow Control
Math
Tuples, Lists, Arrays, and Dictionaries
Classes, Objects and Functions
Lambdas
Random Numbers
96
97
97
97
97
97
97
97
97
CircuitPython Digital In & Out
Find the pins!
Read the Docs
98
99
101
CircuitPython Analog In
Creating the analog input
get_voltage Helper
Main Loop
Changing It Up
Wire it up
102
102
102
102
103
103
CircuitPython Analog Out
Creating an analog output
Setting the analog output
Main Loop
Find the pin
107
107
107
107
108
CircuitPython PWM
PWM with Fixed Frequency
Create a PWM Output
Main Loop
PWM Output with Variable Frequency
Wire it up
Where's My PWM?
112
112
112
112
112
113
117
CircuitPython Servo
Servo Wiring
Servo Code
118
118
120
CircuitPython Cap Touch
Create the Touch Input
Main Loop
Find the Pin(s)
121
121
121
122
CircuitPython Internal RGB LED
Create the LED
Brightness
Main Loop
Making Rainbows (Because Who Doesn't Love 'Em!)
Circuit Playground Express Rainbow
126
126
127
127
128
129
© Adafruit Industries
https://learn.adafruit.com/adafruit-feather-m0-express-designed-for-circuit-python-
circuitpython
Page 5 of 195