Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Designed for CircuitPython (SAMD21 and SAMD51)
- `Adafruit ItsyBitsy M4 Express <https://www.adafruit.com/product/3800>`__



Other Adafruit Boards
~~~~~~~~~~~~~~~~~~~~~

Expand All @@ -59,7 +60,7 @@ Other Adafruit Boards
Other Boards
~~~~~~~~~~~~~~~~~~~~~
- `Raspberry Pi Pico <https://www.adafruit.com/products/4864>`__

- `PJRC Teensy 4.1 <https://www.adafruit.com/products/4622> __

Download
--------
Expand Down
3 changes: 2 additions & 1 deletion circuitpython_kernel/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
ADAFRUIT_VID = 0x239A # SAMD
ESP8266_VID = 0x10C4 # Huzzah ESP8266
PICO_VID = 0x239A # PICO PI
TENNSY_VID = 0x16c0 #PJRC Teensy 4.1

# repl commands
CHAR_CTRL_A = b'\x01'
Expand Down Expand Up @@ -145,7 +146,7 @@ def _find_board(self):
for port in comports():
# print out each device
BOARD_LOGGER.debug(port.device)
if port.vid == ADAFRUIT_VID or port.vid == ESP8266_VID or port.vid == PICO_VID:
if port.vid == ADAFRUIT_VID or port.vid == ESP8266_VID or port.vid == PICO_VID or port.vid == TEENSY_VID:
BOARD_LOGGER.debug(f"CircuitPython Board Found at: {port.device}")
BOARD_LOGGER.debug(f"Connected? {self.connected}")
return port.device
Expand Down
16 changes: 14 additions & 2 deletions docs/boardprep.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Before you start using the CircuitPython_Kernel, you'll need a board running CircuitPython. If you're not sure if
the board plugged into your computer is running CircuitPython, check your file explorer for a drive named `CIRCUITPY`

## Designed for CircuitPython (SAMD21, SAMD51 and RP2040)
## Designed for CircuitPython (SAMD21, SAMD51 and RP2040, NXP iMXRT1062)

### Boards Supported:

Expand All @@ -19,7 +19,7 @@ the board plugged into your computer is running CircuitPython, check your file e
- [ItsyBitsy M4](https://www.adafruit.com/product/3727)

- [Raspberry Pi Pico RP2040](https://www.adafruit.com/product/4864)

- [PJRC Teensy 4.1](https://www.adafruit.com/product/4622)

### Installing CircuitPython Firmware

Expand Down Expand Up @@ -49,6 +49,18 @@ Use `screen` program:

screen <device> 115200

## PJRC Teensy 4.1

The Teensy line of microcontrollers have a different installation to the standard circuitpython installation, requiring a program called Teensy Loader and a hex file.

### Installing CircuitPython Firmware

- Download the Teensy Loader Application: https://www.pjrc.com/teensy/loader.html
- Install the loader following the guide for your specific operating system.
- Download the [CircuitPython Firmware (.hex file) from the CircuitPython Website](https://circuitpython.org/board/teensy41/)
- Once the Teensy Loader is downloaded, press the onboard push button on the Teensy, this places the teensy in the halfkay bootlader mode.
- Open the Teensy Loader Application and select the left most button and upload the downloaded .hex file.
- Unplug and plug the Teensy back in and you are ready to go.

## ampy

Expand Down
160 changes: 160 additions & 0 deletions examples/CPX_Blink_Teensy.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "double-loading",
"metadata": {},
"source": [
"## Blinking an LED"
]
},
{
"cell_type": "markdown",
"id": "increasing-booth",
"metadata": {},
"source": [
"The traditional Hello World in Microcontrollers is the blinking of the onboard LED. This can be done using this Jupyter Notebook."
]
},
{
"cell_type": "markdown",
"id": "colonial-ratio",
"metadata": {},
"source": [
"![cpx led](https://cdn-shop.adafruit.com/970x728/4622-03.jpg)"
]
},
{
"cell_type": "markdown",
"id": "guilty-cincinnati",
"metadata": {},
"source": [
"To Begin let's make sure the kernel in the top left hand corner says CircuitPython. This can be modified by going to the kernel tab and selecting change kernel.\n",
"\n",
"Once this is done we can confirm that Jupyter can read our circuit python board by running:"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "protecting-cache",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"print(os.uname())"
]
},
{
"cell_type": "markdown",
"id": "individual-hybrid",
"metadata": {},
"source": [
"Next to be able to turn on and off the LEDs we import board and digitalIO. Board allows access to the specific pins on the Teensy. DigitalIO creates objects for IO based programming."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "balanced-steps",
"metadata": {},
"outputs": [],
"source": [
"import digitalio\n",
"import board"
]
},
{
"cell_type": "markdown",
"id": "breeding-supervision",
"metadata": {},
"source": [
"Create the digitalio.DigitalInOut object for the LED in the Teensy (Teensy's onboard LED is at D13)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "decreased-little",
"metadata": {},
"outputs": [],
"source": [
"cpx_led = digitalio.DigitalInOut(board.D13)"
]
},
{
"cell_type": "markdown",
"id": "gorgeous-first",
"metadata": {},
"source": [
"Let's change the direction of digitialio.Direction to be an OUTPUT"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "satellite-recycling",
"metadata": {},
"outputs": [],
"source": [
"cpx_led.direction = digitalio.Direction.OUTPUT"
]
},
{
"cell_type": "markdown",
"id": "arabic-aluminum",
"metadata": {},
"source": [
"Finally, let's turn it on by changing the value of the pin to True"
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "increased-target",
"metadata": {},
"outputs": [],
"source": [
"cpx_led.value = True"
]
},
{
"cell_type": "markdown",
"id": "union-lease",
"metadata": {},
"source": [
"Don't want the LED on? Turn it off by switching the value from True to False"
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "noble-record",
"metadata": {},
"outputs": [],
"source": [
"cpx_led.value = False"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "CircuitPython",
"language": "python",
"name": "circuitpython"
},
"language_info": {
"codemirror_mode": {
"name": "python",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"pygments_lexer": "python3",
"version": "3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}