Skip to content

Instantly share code, notes, and snippets.

@mattytrentini
mattytrentini / tinypico_pinout.py
Last active March 24, 2023 02:27
TinyPICO Pinout
import re
tpp = """
┌────┐
╭───┤ ├───╮
│ │ │ │
[MO] [23] │ ⌾ └────┘ ⌾ │ [BAT]
[MI] [19] │ ⌾ ▣ │ ⏚
[SCK] [18] │ ⌾ ⌾ │ [5V]
[SS] [ 5] │ ⌾ ⌾ │ [3V3]
[SCL] [22] │ ⌾ ⌾ │ [ 4] [TCH0] [ADC2-0] [RTC10]
@DavesCodeMusings
DavesCodeMusings / uasyncio_http_echo_server.py
Last active October 26, 2022 06:10
Echo-back HTTP server to demonstrate MicroPython uasyncio
# Example of using uasyncio to run a web server.
# The server does nothing but echo back what was sent to it.
# But the point here is to demonstrate the use of uasyncio, callbacks,
# and the mixing of async and regular (synchronous) functions.
import uasyncio
# This is a synchronous function that gets called from inside the async function.
def create_http_response(body):
res_lines = []
@shawwwn
shawwwn / uping.py
Last active June 21, 2026 11:15
µPing: Ping library for MicroPython
# µPing (MicroPing) for MicroPython
# copyright (c) 2018 Shawwwn <shawwwn1@gmail.com>
# License: MIT
# Internet Checksum Algorithm
# Author: Olav Morken
# https://github.com/olavmrk/python-ping/blob/master/ping.py
# @data: bytes
def checksum(data):
if len(data) & 0x1: # Odd number of bytes
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive