Circuit Python at Noisebridge: Difference between revisions

From Noisebridge
Jump to navigation Jump to search
m (checkpoint edit, still working on it)
No edit summary
Line 12: Line 12:


To see the names of the pins available, enter the REPL (using Mu or a terminal program
To see the names of the pins available, enter the REPL (using Mu or a terminal program
<pre>
import board
import board
dir(board)
dir(board)
 
</pre>
For the LED library, pin 1 = IO1 and so forth...
For the LED library, pin 1 = <tt>IO1</tt> and so forth...


It is possible that the silkscreen labels for pins 12 and 13 have been swapped. Test to make sure!
It is possible that the silkscreen labels for pins 12 and 13 have been swapped. Test to make sure!


== Lolin S2 Mini pinout ==
== Lolin S2 Mini pinout ==
 
<pre>
board.A0 board.IO3
board.A0 board.IO3
board.BUTTON board.IO0
board.BUTTON board.IO0
Line 49: Line 50:
board.IO6
board.IO6
board.IO8
board.IO8
</pre>


==Installing Circuit Python on Lolin S2 Mini boards==


==Installing Circuit Python on Lolin S2 Mini boards==


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.  
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. Install `esptool.py` from
# Install <tt>esptool.py</tt> from
# Download the latest Circuit Python binary from here:
# Put the Lolin S2 board into tty mode: while holding down RESET button, press and release the 0 button
# At the command line, enter <pre> esptool.py -p /dev/ttyACM2 --chip esp32s2 --baud 1000000 write_flash -z 0x0  adafruit-circuitpython-lolin_s2_mini-en_US-8.0.0-beta.6.bin</pre>  (use the filename of the binary you just downloaded, it will be more recent than 8.0.0)
# You can also do the previous step using [https://adafruit.github.io/Adafruit_WebSerial_ESPTool/], but only on Chrome browsers
# Reconnect your S2 Mini board, you should see a thumbdrive appear labeled <syntaxhighlight inline lang="css">CIRCUITPYTHON</syntaxhighlight>
# You are now able to edit <tt>code.py</tt>, add libraries to <tt>/lib</tt>, and connect to the serial port (usually <tt>/dev/ttyACM0</tt> on Mac/Linux or <tt>COM3</tt> on Windows

Revision as of 12:54, 30 April 2023

Circuit Python at Noisebridge

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:

Tips and Tricks

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

import board
dir(board)

For the LED library, pin 1 = IO1 and so forth...

It is possible that the silkscreen labels for pins 12 and 13 have been swapped. Test to make sure!

Lolin S2 Mini pinout

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.IO1
board.IO10
board.IO12
board.IO14
board.IO15 board.LED
board.IO17
board.IO2
board.IO21
board.IO34
board.IO36
board.IO37
board.IO38
board.IO39
board.IO4
board.IO40
board.IO6
board.IO8

Installing Circuit Python on Lolin S2 Mini boards

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. Install esptool.py from
  2. Download the latest Circuit Python binary from here:
  3. Put the Lolin S2 board into tty mode: while holding down RESET button, press and release the 0 button
  4. At the command line, enter
     esptool.py -p /dev/ttyACM2 --chip esp32s2 --baud 1000000 write_flash -z 0x0  adafruit-circuitpython-lolin_s2_mini-en_US-8.0.0-beta.6.bin
    (use the filename of the binary you just downloaded, it will be more recent than 8.0.0)
  5. You can also do the previous step using [1], but only on Chrome browsers
  6. Reconnect your S2 Mini board, you should see a thumbdrive appear labeled <syntaxhighlight inline lang="css">CIRCUITPYTHON</syntaxhighlight>
  7. You are now able to edit code.py, add libraries to /lib, and connect to the serial port (usually /dev/ttyACM0 on Mac/Linux or COM3 on Windows