Skip to content

Instantly share code, notes, and snippets.

View mcauser's full-sized avatar

Mike Causer mcauser

View GitHub Profile
@mcauser
mcauser / au915_vs_as923.md
Last active April 8, 2023 02:59
AU915 vs AS923
// My Functions > Add a core function
// name: Mappers Decoder
// based on https://github.com/hkicko/CubeCell-GPS-Helium-Mapper
function Decoder(bytes, port) {
var decoded = {};
var latitude = ((bytes[0]<<16)>>>0) + ((bytes[1]<<8)>>>0) + bytes[2];
latitude = (latitude / 16777215.0 * 180) - 90;
var longitude = ((bytes[3]<<16)>>>0) + ((bytes[4]<<8)>>>0) + bytes[5];
# check device is responding
AT
# verbose logging
AT+LOG=DEBUG
# switch to AU915
AT+DR=AU915
# before 2022-11-17
@mcauser
mcauser / tinys2_ips_cpy_demo.py
Last active October 15, 2021 02:24
UM TinyS2+IPS CircuitPython eg
# UM TinyS2 + RGB IPS Display Shield CircuitPython example
# https://unexpectedmaker.com/tinys2
# https://www.tinypico.com/add-ons
# https://circuitpython.org/board/unexpectedmaker_tinys2/
# https://github.com/adafruit/Adafruit_CircuitPython_ST7735
# The IPS display has pins labelled for TinyPICO.
# These are the matching TinyS2 pins.
!blue 0 0
!blue 0 1
!blue 0 2
!blue 0 3
!blue 0 4
!blue 0 5
!blue 0 6
!blue 0 18
!blue 0 19
!blue 0 20
Mikes-MacBook-Pro:~ mike$ esptool.py flash_id
esptool.py v2.8
Found 3 serial ports
Serial port /dev/cu.SLAB_USBtoUART
Connecting....
Detecting chip type... ESP32
Chip is ESP32-PICO-D4 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, Embedded Flash, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 24:a1:60:74:e5:b0
import ustruct
class MAX31855:
"""
Driver for the MAX31855 thermocouple amplifier.
MicroPython example::
:020000040000FA
:100000000040002081610100BD610100BF6101006D
:1000100000000000000000000000000000000000E0
:10002000000000000000000000000000C1610100AD
:100030000000000000000000C3610100C561010074
:10004000C7610100D95A0100E5650100C7610100DF
:10005000C761010000000000BD9B0100C7610100F5
:10006000F9F00000C7610100C19D0100C7610100F6
:10007000C7610100C7610100C7610100C7610100DC
:10008000C76101003D6B0100C7610100C76101004C
@mcauser
mcauser / gist:8d0e75dfeda0d40c0a57a60a29aa01bf
Created June 20, 2017 08:25
micropython BLACK_F407VE dfu steps
Copy files from https://github.com/mcauser/BLACK_F407VE into micropython/stmhal/boards/BLACK_F407VE
$ cd stmhal
$ make clean
$ make BOARD=BLACK_F407VE
Use make V=1 or set BUILD_VERBOSE in your environment to increase build verbosity.
mkdir -p build-BLACK_F407VE/genhdr
Create build-BLACK_F407VE/genhdr/pins.h
@mcauser
mcauser / micropython-esp32-lolin32-osx.txt
Last active May 17, 2017 01:06
micropython-esp32-lolin32-osx
See here for latest tar.gz path: http://esp-idf.readthedocs.io/en/latest/get-started/macos-setup.html
$ mkdir -p ~/esp
$ cd ~/esp
$ wget https://dl.espressif.com/dl/xtensa-esp32-elf-osx-1.22.0-61-gab8375a-5.2.0.tar.gz
$ tar -xzf xtensa-esp32-elf-osx-1.22.0-61-gab8375a-5.2.0.tar.gz
$ subl ~/.profile
export PATH=$PATH:$HOME/esp/xtensa-esp32-elf/bin
$ source ~/.profile