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!
examples for micropython on teensies
Re: examples for micropython on teensies
The SPI and I2C drivers haven't yet been implemented for teensy. GPIO works. Timers work.
Re: examples for micropython on teensies
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?
To follow up, does the teensy port of micropython work only interactively, or is it possible to upload a code that will run autonomously?
Re: examples for micropython on teensies
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.
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.