Skip to content

Instantly share code, notes, and snippets.

Avatar

Gerad Munsch unforgiven512

View GitHub Profile
@unforgiven512
unforgiven512 / Generic_RTLSDR_Remote.txt
Last active May 8, 2020
Generic RTL-SDR remote LIRC config
View Generic_RTLSDR_Remote.txt
#
# brand: Generic
# model no. of remote control: Generic RTL-SDR remote
# devices being controlled by this remote: Generic RTL-SDR stick
#
begin remote
name Generic RTL-SDR remote
bits 16
@unforgiven512
unforgiven512 / irrecord_key_and_button_namespace.md
Last active Mar 4, 2020
Organized list of LIRC button names
View irrecord_key_and_button_namespace.md

lirc -- keys & buttons namespace

The list was obtained using the following command...

# irrecord --list-namespace

...and was obtained from [this website][1].

@unforgiven512
unforgiven512 / comed_hourlypricing_data.py
Created Jul 19, 2019
Improved ComEd Hourly Pricing python script
View comed_hourlypricing_data.py
#!/usr/bin/env python2
import argparse
import locale
import logging
import time
import threading
import json
import requests
import datetime
@unforgiven512
unforgiven512 / example.py
Created Jul 18, 2019
INA219 library (example) for MicroPython on ESP8266
View example.py
from machine import Pin, I2C
from ina219 import INA219
from logging import INFO
SHUNT_OHMS = 0.1
i2c = I2C(-1, Pin(5), Pin(4))
ina = INA219(SHUNT_OHMS, i2c, log_level=INFO)
ina.configure()
@unforgiven512
unforgiven512 / README.md
Created Jul 18, 2019
README for INA219 library for MicroPython on ESP8266
View README.md

Using the Library on an ESP8266

On the NodeMCU clone I used to test with I got an out of memory error when trying to import the ina219 module, this is due to there being insufficient RAM to compile this module to byte code. If you encounter this issue then you can use the frozen byte code as explained below.

Usage

This is an example script:

from machine import Pin, I2C
@unforgiven512
unforgiven512 / README.md
Created Jul 18, 2019
README for INA219 library for MicroPython on ESP8266
View README.md

MicroPython Library for Voltage and Current Sensors Using the INA219

This MicroPython library for the INA219 voltage, current and power monitor sensor from Texas Instruments. The intent of the library is to make it easy to use the quite complex functionality of this sensor.

The functionality is currently under development and is based on my INA219 library for the Raspberry Pi.

The library currently only supports continuous reads of voltage and

@unforgiven512
unforgiven512 / example.py
Created Jul 18, 2019
INA219 library (example) for MicroPython on ESP8266
View example.py
"""Example script.
Edit the I2C interface constant to match the one you have
connected the sensor to.
"""
from ina219 import INA219
from machine import I2C
# Edit to match interface the sensor is connect to (1 or 2).
@unforgiven512
unforgiven512 / example.py
Created Jul 18, 2019
INA219 library (example) for MicroPython
View example.py
"""Example script.
Edit the I2C interface constant to match the one you have
connected the sensor to.
"""
from ina219 import INA219
from machine import I2C
# Edit to match interface the sensor is connect to (1 or 2).
@unforgiven512
unforgiven512 / ina219.py
Created Jul 18, 2019
INA219 library for MicroPython
View ina219.py
"""MicroPython library for the INA219 sensor.
This library supports the INA219 sensor from Texas Instruments with
MicroPython using the I2C bus.
"""
import logging
import utime
from math import trunc
from micropython import const
@unforgiven512
unforgiven512 / ssd1306.py
Created Jul 18, 2019
old ssd1306.py library file on MicroPython ESP8266 board #7
View ssd1306.py
"""
This is a MicroPython driver for the SSD1306 OLED display.
The driver implements both the I2C and SPI interfaces, as the SSD1306 is available with either interface.
"""
# MicroPython SSD1306 OLED driver, I2C and SPI interfaces
from micropython import const
import time
You can’t perform that action at this time.