Skip to content

Latest commit

 

History

History
66 lines (40 loc) · 3.71 KB

README.md

File metadata and controls

66 lines (40 loc) · 3.71 KB

Introduction to the Internet of Things

  1. Overview
  2. Intro
  3. Resources
  4. Python vs. MicroPython vs. CircuitPython
  5. Getting Started with CircuitPython on nRF52840
  6. Getting Started with Python on Raspberry Pi

Overview

This introduction should enable you to set up and use your computer in a way that makes getting started with IoT easy.

We will set up two boards, a Raspberry Pi and a microcontroller, so you can answer the following questions:

  • How is an embedded Linux or a CircuitPython-based microcontroller connected to your computer?
  • What does it take to program a Raspberry Pi or a CircuitPython-based microcontroller?
  • How does a Linux computer like the Raspberry Pi differ from a microcontroller?

Intro

The IoT creates opportunities for more direct integration of the physical world into computer-based systems, resulting in efficiency improvements, economic benefits, and reduced human exertions.

— Quote from Wikipedia

Resources

Python vs. MicroPython vs. CircuitPython

Finally, Python had moved off of desktops and servers and into the world of sensors, actuators, motors, LCD displays, buttons, and circuits. While this presented many challenges, there were also copious opportunities. Desktop and server hardware requires gigahertz processors, gigabytes of RAM, and terabytes of storage. They also need fully-fledged operating systems, device drivers, and true multitasking.

In the microcontroller world, however, MicroPython is the operating system.

— Quote from MicroPython: An Intro to Programming Hardware in Python

MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments.

— Quote from the MicroPython Website

CircuitPython is a programming language designed to simplify experimenting and learning to code on low-cost microcontroller boards. [It] wouldn't exist without the awesome work of Damien George and the MicroPython community.

— Quote from the CircuitPython Website

Note: We will use CircuitPython for our labs and examples. The entry into microprocessor programming is easiest with CircuitPython.

Developing with CircuitPython

Check the following points:

  • Choose an editor: We recommend the Mu-editor which can be downloaded from https://codewith.mu/. Mu is easy to use and features a serial console, which is needed to see print() statements.

    Note for MacOS Users with Catalina or Big Sur:
    Start the application the first time with the CTRL key pressed to be able to accept the security restrictions by the macOS.

    You will find in this chapter other editors, which are suitable for CircuitPython programming.

  • Connect the Feather nRF52840 Express via USB to your computer. Check if you see the CIRCUITPY drive on your desktop.

The CircuitPython Reference Docs can be found on https://circuitpython.readthedocs.io/en/latest/README.html

Getting Started with CircuitPython on nRF52840

Follow the steps in Getting Started with CircuitPython on nRF52840

Getting Started with Python on Raspberry Pi

Follow the steps in Getting Started with Python on Raspberry Pi