Skip to content

Instantly share code, notes, and snippets.

View Andrei-Pozolotin's full-sized avatar

Andrei Pozolotin Andrei-Pozolotin

View GitHub Profile
@Andrei-Pozolotin
Andrei-Pozolotin / arkon.md
Last active December 13, 2023 01:23
esp32.RMT

RE: micropython/micropython#7015

GIST: https://gist.github.com/Andrei-Pozolotin/c4b3dd041efe53cfb92cfb4de9c67267

Here is a working experimental implementation. Basic approach is:

  • use piecewise interpolation for stepper motor pulse profile
  • persist interpolation segments once, inside esp32.RMT.items store
  • start sending pulses from items store with rmt.h | rmt_set_clk_div() and rmt.h | rmt_write_items()
  • continue sending by switching between pulse patterns with rmt.h | rmt_register_tx_end_callback() system ISR
//
// https://github.com/bogde/HX711
//
// sensor setup:
// * 5V supply (from nano)
// * 128 gain (library config)
// * +-20 mV input range (derived from gain)
// * int32_t output range (library convention)
// * 80 Hz (12.5 ms) sample rate (jumper on board)
//
"""
"""
import tester
import logging
from logging.config import fileConfig
from sqlalchemy import pool
from sqlalchemy import engine_from_config
"""
robust cluster connection pool
"""
import asyncio
import logging
from contextvars import ContextVar
from typing import Awaitable
from typing import List
from typing import Mapping
master nice=0
worker index=2 nice=19
worker index=1 nice=19
worker index=3 nice=19
worker index=4 nice=19
worker index=5 nice=19
worker index=6 nice=19
worker index=7 nice=19
worker index=9 nice=19
worker index=8 nice=19
master nice=0
worker index=1 nice=19
worker index=2 nice=19
worker index=3 nice=19
worker index=4 nice=19
worker index=5 nice=19
worker index=6 nice=19
worker index=7 nice=19
worker index=8 nice=19
worker index=9 nice=19
--- session=0 ---
count=100000 time_diff=0.179 time_unit=1 micro
--- session=1 ---
count=100000 time_diff=0.168 time_unit=1 micro
--- session=2 ---
count=100000 time_diff=0.168 time_unit=1 micro
--- session=0 ---
count=100000 time_diff=2.300 time_unit=23 micro
--- session=1 ---
count=100000 time_diff=2.262 time_unit=22 micro
--- session=2 ---
count=100000 time_diff=2.145 time_unit=21 micro
@Andrei-Pozolotin
Andrei-Pozolotin / a-pyinstrument-70.txt
Last active September 3, 2019 22:48
a-pyinstrument-70
https://github.com/joerick/pyinstrument/issues/70