examples for micropython on teensies

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
Post Reply
greentree
Posts: 15
Joined: Wed Dec 16, 2015 3:16 am

examples for micropython on teensies

Post by greentree » Wed Dec 16, 2015 3:27 am

Are there examples or a tutorial about how to implement OneWire and I2C on teensies running micropython? I've tried executing the onewire.py and ds18x20.py drivers interactively over minicom. They seem to execute but calls to a DS18X20 object fails to detect a DS18B20 temp sensor. The sensor is detected using arduino libraries via teensyduino.

Ideally I'd like to make data loggers using an SPI sd card reader. Is it possible to make this work, or does the teensy implementation lack critical capabilities at this point?

Thanks for any insights!

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: examples for micropython on teensies

Post by dhylands » Wed Dec 16, 2015 7:02 pm

The SPI and I2C drivers haven't yet been implemented for teensy. GPIO works. Timers work.

greentree
Posts: 15
Joined: Wed Dec 16, 2015 3:16 am

Re: examples for micropython on teensies

Post by greentree » Wed Dec 23, 2015 3:55 pm

Dave, thanks for the reply.

To follow up, does the teensy port of micropython work only interactively, or is it possible to upload a code that will run autonomously?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: examples for micropython on teensies

Post by dhylands » Wed Dec 23, 2015 4:15 pm

The teensy doesn't have a filesystem like the pyboard does (there isn't enough flash). So the python code that you want to run needs to be baked into the firmware.

Now there is a way of doing this using what's referred to as "frozen modules".

When you build the teensy firmware, you can provide a variable called FROZEN_DIR to make, and all of the files in that directory will be collected into the firmware. You can then import them as you would if they were on a file system like on the pyboard.

So you can provide a boot.py and main.py and any other python files that you like using that mechanism.

Post Reply