Python on Hardware
2020-09-09 | By Maker.io Staff
Circuit Playground Adafruit Feather Gemma ItsyBitsy micro:bit
A whole generation of programmers have now grown up with the web, where JavaScript is the de facto language for creating dynamic user interfaces and managing databases. Alongside them is another, even larger, group who have made Python the de facto language of science, engineering, data analysis, and most recently machine learning. The emerging future communities we're seeing are being built not around specific chipsets or boards, but around languages. These modern languages are high level in that they are more than just a syntax-tree and compiler. They are fully-featured development environments that come with comprehensive libraries, code examples and support networks High-level language support is fundamentally disruptive to the way we currently build hardware.
Most people, and most makers, want to solve a problem. Maybe they're sending sensor data to the internet for an IoT device, or listening for radio signals that will move a motorized robot. While, for some, the specifications of the chipset or board really matter - the number of timers, the specs of the ADC controller - the across-the-board increases in microcontroller/microcomputer power and capabilities means that, often times, the specs don't vary that much. In a move that mirrors the changes we saw in the desktop and laptop computer market, our microcontroller hardware has become good enough that we now don't have to worry about the underlying architectures and instead, we can focus on application engineering.
When it comes down to it, the next generation of high powered microcontrollers and microcomputers will be defined, not by their hardware, but by their user experience. UIs will be rich and complex, with TFTs and OLEDs (a single button and buzzer will not suffice). Connectivity is now a given, you must have a stack for managing Internet or Bluetooth. And with such complexity, we need higher level languages. The future of hardware is about accessibility, and we will be programming using an easily accessible, and widely known, high level language like Python.
CircuitPython
CircuitPython is Adafruit's branch of MicroPython designed to simplify experimentation and education on low-cost microcontrollers. It's fully interpreted, with the interpreter acting as your RTOS (of sorts). No compiler, linker or IDE required! Now you can code directly on the device itself. CircuitPython makes it easier than ever to get prototyping by requiring no up-front desktop software downloads - open up the embedded code.py text file in any text editor and type away.
It is great for beginners: With CircuitPython you can write clean and simple Python code to control hardware instead of having to use complex low-level languages like Arduino, C or C++. The simplicity of the Python programming language makes CircuitPython an excellent choice for beginners who are new to programming and hardware.
Experts love it too: skip the annoyances of long-compile cycles, pointers and memory management - get right to the programming you want to do. CircuitPython is also full-featured and supports all of Python's syntax (Python version 3.4) and implements some useful parts of the Python standard library so even seasoned Python veterans will find CircuitPython familiar and fun to use.
Adafruit's latest boards are the Metro, the Feather, and the ItsyBitsy (from largest to smallest). The Metro board features powerful Microchip Technologies SAMD51 microcontrollers with the ARM Cortex M4 core which includes hardware floating point support and DSP operations.
Running at 120 MHz and containing more RAM and Flash than prior boards, the new Adafruit boards are tailor-made for running CircuitPython quickly and effectively for taxing applications.
On the educational side, the Adafruit Circuit Playground Express provides the power of CircuitPython with the sensors and lights all on-board. It contains the features most requested from the educational community with ease of use and broad software compatibility.
The Adafruit Gemma M0, about the size of a U.S. quarter, is perfect for small wearables. The Trinket M0 is most often used in compact breadboard-friendly designs. Adafruit's Metro M0 Express provides shield-compatibility with the Arduino ecosystem. Finally, the Adafruit Feather M0 Express has dozens of companion boards which take advantage of the Feather system.
Articles
- The Basics of CircuitPython for Rapid Microcontroller-Based Prototyping and Development
- Develop Real-Time Microcontroller-Based Applications Quickly Using MicroPython
- Welcome to the Wireless Menagerie: RF Bands and Protocol Choices for Embedded Developers, Part 2
- How to Easily Add Multiple Wireless Technologies to an IoT Design
- Simplify ARM® Cortex®-M0+-Based IoT Embedded Design with CircuitPython Dev Boards
- How a New Breed of Wireless MCUs and Modules Are Enabling Connected IoT Applications
- Build a Machine Learning Application with a Raspberry Pi
Blogs
- How to get Python Running on a Circuit Playground Express
- How to Create a Raspberry Pi Python Program
- How to Run Python Programs on a Raspberry Pi
- Raspberry Pi Examples with Click Boards
- Introduction to MicroPython
- Cellular Beaglebone IoT Kit
- Programming MicroPython on the ESP8266
- How to Install Eclipse on a Raspberry Pi
- Use MicroPython in Microcontrollers
- The True Cost of Prototypes
Guides
- Welcome to CircuitPython! - An overview of CircuitPython and the community.
- CircuitPython Essentials - Learning the essential functions of CircuitPython.
- learn.adafruit.com CircuitPython - Adafruit Learning Guides on CircuitPython.
- learn.adafruit.com CircuitPython & MicroPython - Guides on both CircuitPython and MicroPython.
Projects
- Python Programming Tutorial: Getting Started with the Raspberry Pi
- Circuit Python TV Zapper with Circuit Playground Express
- CircuitPython Hardware: ILI9341 TFT & FeatherWing
- NeoAnim: Using Bitmaps to Animate NeoPixels on Circuit Playground
- Circuit Playground Firmata
- CircuitPython-Powered 3-minute Nightlight
- Graph Sensor Data with Python and Matplotlib
- How to Load MicroPython on a Microcontroller Board
- Make It Glow With Crickit
- MicroPython Displays: Drawing Shapes
- Python GUI Guide: Introduction to Tkinter
- CircuitPython with Jupyter Notebooks
- How to Run a Raspberry Pi Program on Startup
- MicroPython Programming Tutorial: Getting Started with the ESP32 Thing
- MicroPython Basics: What is MicroPython?
- Building CircuitPython
- MicroPython Basics: Load Files & Run Code
- MicroPython Basics: Loading Modules
- Building CircuitPython
- How to Build a Photon MQTT Logger
- Low-Cost Data Acquisition (DAQ) with Arduino and Binho for ML
- Edge AI Anomaly Detection Part 1 - Data Collection
- Edge AI Anomaly Detection Part 3 - Machine Learning on Raspberry Pi
- Pathfinder Robot Companion
Community
- Adafruit CircuitPython Forums - The Adafruit discussion forum on CircuitPython.
- Adafruit CircuitPython Discord channel #CircuitPython - 24/7 chat and support on CircuitPython including a weekly podcast.
Books
- Python for Microcontrollers - by Donald Norris, Discusses how to get started with MicroPython and Pyboard.
- Programming with MicroPython - by Nicholas H. Tollervey, includes CircuitPython - Discusses the MicroPython language.
Videos
- Intro to MicroPython – Maker.io Tutorial | DigiKey
- MicroPython & the Circuit Playground Express – Maker.io Tutorial | DigiKey
- GOTO 2016 • MicroPython & the Internet of Things • Damien George
- Python on Hardware weekly VideoCast!
Code
- CircuitPython API Reference - A list of functions and documentation available for CircuitPython.
- Circuit Playground Express CircuitPython API Reference - The functions and documentation specific to the Circuit Playground Express using CircuitPython.
- CircuitPython GitHub Repository - The source code for CircuitPython on GitHub.
- MicroPython GitHub Repository - The source code for MicroPython on GitHub.
Frameworks
- The Mu Editor, IDE, REPL, and plotter for CircuitPython - The recommended Python editor for CircuitPython.
- For developers, Mu: A Python Code Editor - The documentation for Mu.
Newsletter
- Adafruit Daily, Python for microcontrollers - A weekly newsletter on MicroPython and CircuitPython, a spam-free list.
- Contribute to newsletter - Guidelines on contributing to the newsletter.
News
- CircuitPython in 2018 - An article discussing the future directions for CircuitPython.
- CircuitPython on the Adafruit.com/blog - Adafruit Blog posts discussing CircuitPython.
- CircuitPython Snakes its Way onto Adafruit Hardware - An article by MAKE on CircuitPython.
- Adafruit Circuit Playground Express review - Raspberry Pi reviews the Circuit Playground Express.
- CircuitPython on Hackaday - Hackaday posts related to CircuitPython.
Social
- #CircuitPython tagged on Twitter, latest - Twitter posts tagged CircuitPython.
- MicroPython - Twitter profile for the MicroPython.
- CircuitPython videos on YouTube, latest - YouTube posts tagged CircuitPython.
- #CircuitPython tagged photos & videos on Instagram - Posts on Instagram tagged CircuitPython.
- CircuitPython - micropython.org forums - Articles on the MicroPython forums tagged for CircuitPython.
- Pinterest post: MicroPython on ESP32: Tools – virtual environments vs system installs
Events
- Weekly community chat on Adafruit Discord server CircuitPython channel - The Discord chat space for CircuitPython.
- ASK AN ENGINEER, Wednesday 8pm ET on YouTube LIVE - The longest running YouTube live show hosts information on CircuitPython.
Products
- MicroPython
- 1528-2138-ND: ATSAMD21G18 Metro M0 Express SAM D MCU 32-Bit ARM® Cortex®-M0+
- 1528-2554-ND: ATSAMD21 ItsyBitsy M0 Express SAM D MCU 32-Bit ARM®
- 1528-2619-ND: ATSAMD51J19 ItsyBitsy M4 Express SAM D MCU 32-Bit ARM® Cortex®-M4
- 1528-2605-ND: ATSAMD51J19 METRO SAM D MCU 32-Bit ARM® Cortex®-M4
- 1528-2280-ND: Adafruit's ATSAMD21 Circuit Playground Express SAM D MCU 32-Bit ARM® Cortex®-M0+ Embedded Evaluation Board
- 1528-2126-ND: Adafruit's ATSAMD21G18 Feather M0 Express SAM D MCU 32-Bit ARM® Cortex®-M0+ Embedded Evaluation Board
- 1528-2348-ND: Adafruit's ADAFRUIT GEMMA M0 - MINIATURE WE
- 1528-2361-ND: Adafruit's TRINKET M0 ATSAMD21E18 DEV BOARD
- 1528-1580-ND: Adafruit's ADAFRUIT FEATHER M0 WIFI - ATSAM
- 1528-1530-ND: Adafruit's ESP8266 FEATHER HUZZAH LOOSE HDR
- 1528-1901-ND: Adafruit's ESP8266 FEATHER HUZZAH FIXED HDR
- 1528-1902-ND: Adafruit's ESP8266 FEATHER HUZZAH STACK HDR
- 1528-1539-ND: Adafruit's ATSAMD21G18 Data Logger Memory Evaluation Board
- 1528-1531-ND: Adafruit's ATSAMD21G18 Feather M0 Basic Proto SAM D MCU 32-Bit ARM® Cortex®-M0+ Embedded Evaluation Board
- 1528-1565-ND: Adafruit's STM32F405 PyBoard STM32F4 MCU 32-Bit ARM® Cortex®-M4 Embedded Evaluation Board
- BBB01-SC-505-ND: GHI Electronics' AM3358BZCZ BeagleBone Black Sitara™ MPU ARM® Cortex®-A8 Embedded Evaluation Board
- 2648-SC0022-ND: Raspberry Pi's BCM2837 Raspberry Pi 3 Model B - MPU ARM® Cortex®-A53, VideoCore Embedded Evaluation Board
- 2648-SC0073-ND: Raspberry Pi's BCM2837B0 Raspberry Pi 3 Model B+ - MPU ARM® Cortex®-A53, VideoCore Embedded Evaluation Board
- 1910-1000-ND: Pi Supply's BCM2835 Raspberry Pi Zero W - MPU ARM11 Embedded Evaluation Board
- 1910-1001-ND: Pi Supply's BCM2835 Raspberry Pi Zero - MPU ARM11 Embedded Evaluation Board
- 1050-1137-ND: Arduino's ATSAMD21 Arduino MKR Zero SAM D MCU 32-Bit ARM® Cortex®-M0+ Embedded Evaluation Board
- 1528-2095-ND: Adafruit's FEATHER NRF52 BLUEFRUIT LE - NRF
- 1871-1000-ND: Pycom's WIPY 2.0 IOT DEV BOARD
![TechForum](http://www.digikey.com/-/media/Images/Footer/TechForum2.png?la=en&ts=9efa75a7-28fd-48d1-bcf2-3300f3edfa4e)
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum