This guide is part of a series on some of the more advanced features of Python, and specifically CircuitPython. Are you new to using CircuitPython? No worries, there is a full getting started guide here.
Adafruit suggests using the Mu editor to edit your code and have an interactive REPL in CircuitPython. You can learn about Mu and its installation in this tutorial.
If you've been introduced to Python through CircuitPython, you might not have written many functions yet. With the ATSAMD51 series of boards with its Cortex-M4 core what you can do with CircuitPython expands greatly. That means you can write larger, more complex programs that do more complex and interesting things. That complexity can quickly get out of hand. Functions are a tool to help manage that complexity.
Functions let you package up blocks of code to help make your programs more reusable, shareable, modular, and understandable.
This guide will go over the basics of using functions in CircuitPython.
Text editor powered by tinymce.