This repository holds code used in the ME405 course at Cal Poly.
The documentation pages are at https://spluttflob.github.io/ME405-Support/.
- These files are used to implement cooperative multitasking in MicroPython.
The
cotask.pyandtask_share.pymodules are central to this structure.
-
src/nb_input.pycontains a class which implements non-blocking input from a serial port on a microcontroller running MicroPython. -
examples/what_you_said.pyhelps to test serial communications between a microcontroller running MicroPython and a PC running a regular Python program. -
examples/test_kbd.pydemonstrates one way to use thekeyboardmodule to allow Python to read individual key presses on a PC, not on a microcontroller. -
examples/vend_kb.pydemonstrates another method to do non-blocking reads on a PC. -
custom_micropythonhas some support to help those who wish to compile their own ME405 style custom MicroPython firmware.
-
The file
firmware.bincontains a custom version of MicroPython for use only on an STM32L476RG Nucleo. It supports extra UARTs, DAC, and the use of the USB-OTG connector on the Shoe of Brian (see the github-pages documents) to connect the/flashdirectory as a USB drive. CAN is not supported, as the pins needed are used by the USB-OTG connector.This firmware file also contains MicroPython-ulab, the NumPy/SciPy partial workalike library found at https://github.com/v923z/micropython-ulab, and
cqueue, a module hosted in this repository which contains fast and efficient queues to transfer data between tasks.
Most homework support is maintained by the course instructors. If any additional files are needed, they may be kept here.