Circuit Python at Noisebridge

From Noisebridge
Jump to navigation Jump to search

Circuit Python at Noisebridge[edit]

Welcome to this page, which will get you started with Circuit Python. You can do this any time, or with a group at Circuit Hacking Monday

Some links to get started:

Getting Started with Programming[edit]

Hooking up Hardware[edit]

We have soldering equipment so you can install the headers that came with your board. A good tip is to put the headers into a solderless breadboard before soldering so they are straight and even. Only install the outside headers if you want to use this in a solderless breadboard otherwise they will short! We have lots of hardware to play with including sensors and Neopixel LEDs; you will need the Adafruit library:

Tips and Tricks[edit]

To see the names of the pins available, enter the REPL (using Mu or a terminal program

import board
  • For the LED library, pin 1 = IO1 and so forth... If you have installed only the outside headers, use pin IO3 (or odd numbered pins) so that there's something to connect to.
  • It is possible that the silkscreen labels for pins 12 and 13 have been swapped. Test to make sure!
  • Todbot has some fun code to play with, like synthesizers!

Lolin S2 Mini pinout[edit]

board.A0 board.IO3
board.BUTTON board.IO0
board.D0 board.IO5
board.D1 board.IO35 board.SCL
board.D2 board.IO33 board.SDA
board.D3 board.IO18
board.D4 board.IO16
board.D5 board.IO7 board.SCK
board.D6 board.IO9 board.MISO
board.D7 board.IO11 board.MOSI
board.D8 board.IO13
board.IO15 board.LED

Installing Circuit Python on Lolin S2 Mini boards[edit]

We have already done this for you! But you might need to do it again, or if you get your own boards, this is how we do it.

  1. Download the latest Circuit Python binary from here:
  2. Put the Lolin S2 board into tty mode: while holding down the "0" button, press and release the "RESET" button. Make sure there's a tty (com port) available.
  3. Install frop PIP: python -m pip install esptool
  4. At the command line, enter -p /dev/ttyACM0 --chip esp32s2 --baud 1000000 write_flash -z 0x0 adafruit-circuitpython-lolin_s2_mini-en_US-8.0.0-beta.6.bin
    (use the right serial port if not ttyACM0, also use filename of the binary you just downloaded: it will be more recent than 8.0.0)
  5. (if this doesn't work at first, try erasing flash with --port PORT_NAME erase_flash, and/or repeat until it enumerates as /dev/ttyACM1)
  6. You can also do the previous 2 steps using or but only on Chrome browsers. This can fix problems if esptool is not working.
  7. Reconnect your S2 Mini board, you should see a removable drive appear labeled CIRCUITPY
  8. You are now able to edit, add libraries to /lib, and connect to the serial port (usually /dev/ttyACM0 on Mac/Linux or COM3 on Windows