Skip to content

Instantly share code, notes, and snippets.

View Josverl's full-sized avatar

Jos Verlinde Josverl

View GitHub Profile
@Josverl
Josverl / DIY-stubs.md
Last active April 16, 2024 12:19
DIY Stub file creation for MicroPython

DIY Stub file creation for MicroPython

To create stubs for your MicroPython board, you can use the micropython-stubber package. This package will connect to your board and create a set of stub files that you can use in your IDE to get code completion and type checking.

The recomnedation is:

  • To create a folder from which to run the tool and store the various repos and files
  • optionally to create a .venv virtual environment to run the tool in.

install micropython-stubber

@Josverl
Josverl / board_info.csv
Last active January 4, 2024 08:39
Test to measure the performance of reading a MPremote --mounted filesystem
board description
4MB/OTA module with ESP32 GENERIC_OTA
Actinius Icarus with NRF9160 ACTINIUS_ICARUS
Adafruit Feather RP2040 ADAFRUIT_FEATHER_RP2040
Adafruit Feather STM32F405 with STM32F405RG ADAFRUIT_F405_EXPRESS
Adafruit ItsyBitsy RP2040 ADAFRUIT_ITSYBITSY_RP2040
Adafruit Metro M7 with MIMXRT1011DAE5A ADAFRUIT_METRO_M7
Adafruit QT Py RP2040 ADAFRUIT_QTPY_RP2040
Arduino GIGA R1 WiFi with STM32H747 ARDUINO_GIGA
Arduino Nano 33 BLE Sense with NRF52840 ARDUINO_NANO_33_BLE_SENSE
@Josverl
Josverl / _thread.pyi
Last active September 4, 2023 15:54
proposal _threads stub
"""
Manual typestub for _thread module.
multithreading support. See: https://docs.micropython.org/en/v1.20.0/library/_thread.html
|see_cpython_module| :mod:`python:_thread` https://docs.python.org/3/library/_thread.html .
This module implements multithreading support.
This module is highly experimental and its API is not yet fully settled
@Josverl
Josverl / API-Test.ipynb
Last active November 1, 2023 23:22
mpremote API
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Josverl
Josverl / ac_colors.json
Created July 4, 2023 09:41
Adaptive Card with multiple accents / Colors
{
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Container _WITH_ a select action. Text should show be in color specified in the card in non-HighContrast, and the High Contrast _BUTTON_ color in HighContrast.",
"wrap": true,
"weight": "Bolder"
},
@Josverl
Josverl / plot.py
Last active June 29, 2023 18:27
Matplotlib with many text lablels decluttered.
%matplotlib widget
from matplotlib import ticker
import matplotlib.pyplot as plt
import numpy as np
fig, ax = plt.subplots(figsize=(8, 2.5))
# list of desciptions for the x-axis
x = mi_list.np_array["description"]
x = [f'Step-{xx}' for xx in np.arange(100)]
@Josverl
Josverl / results.log
Last active June 27, 2023 12:45
mpremote testing on windows
./test_eval_exec_run.sh: OK
./test_filesystem.sh: FAIL
11c11
< e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 *-
---
> e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -
13,15c13,15
< cp C:/Users/josverl/AppData/Local/Temp/tmp.8pLK9lHdYn/a.py :
< cp C:/Users/josverl/AppData/Local/Temp/tmp.8pLK9lHdYn/a.py :b.py
< cp C:/Users/josverl/AppData/Local/Temp/tmp.8pLK9lHdYn/a.py :c.py
@Josverl
Josverl / flash_stm32.md
Last active June 27, 2023 17:13
Flashing STM32 devices

Flash STM32 boards on Windows, Linux and Mac OS using the STM32CubeProgrammer

Download the STM32CubeProgrammer software from the ST website. https://www.st.com/en/development-tools/stm32cubeprog.html#overview

install it and add it to your shell's path (e.g. .bashrc or .profile)

add to path if not already there. $env:Path += ";C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin"

@Josverl
Josverl / sample.ps1
Last active April 3, 2023 14:46
pip Install from git branch and subfolder
$branch = "add_callable"
$repo = "https://github.com/Josverl/micropython-stubs"
$package = "micropython-esp32-stubs"
$folder = "publish/micropython-v1_19_1-esp32-stubs"
# install stub package to typings folder
pip install -U "git+$repo/@$branch#egg=$package&subdirectory=$folder" --no-user --target typings
@Josverl
Josverl / stubber.mmd
Last active March 31, 2023 16:33
stubber diagram
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.