Skip to content

Instantly share code, notes, and snippets.

View unforgiven512's full-sized avatar

Gerad Munsch unforgiven512

View GitHub Profile
@unforgiven512
unforgiven512 / example.py
Created July 18, 2019 21:58
INA219 library (example) for MicroPython on ESP8266
"""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 / README.md
Created July 18, 2019 21:59
README for INA219 library for MicroPython on ESP8266

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 / comed_hourlypricing_data.py
Created July 19, 2019 15:39
Improved ComEd Hourly Pricing python script
#!/usr/bin/env python2
import argparse
import locale
import logging
import time
import threading
import json
import requests
import datetime
@unforgiven512
unforgiven512 / Generic_RTLSDR_Remote.txt
Last active May 8, 2020 12:27
Generic RTL-SDR remote LIRC config
#
# 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 / example.py
Created July 18, 2019 22:00
INA219 library (example) for MicroPython on ESP8266
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 July 18, 2019 22:00
README for INA219 library for MicroPython on ESP8266

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 / eagle-200-curl.md
Created April 22, 2022 17:20 — forked from darconeous/eagle-200-curl.md
Eagle-200 Local Usage via CURL

Eagle-200 Local Usage via CURL

You can locally pull data from your Rainforest Eagle-200 using cURL.

Rainforest has published a local API document which explains the details of the protocol. But this particular document is about quickly getting to the point and giving you some cURL commands you can use to immediately start pulling out data.

Prerequisites

First, I'll assume that you have the following environment variables set:

@unforgiven512
unforgiven512 / ina219.py
Created July 18, 2019 21:57
INA219 library for MicroPython
"""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 / irrecord_key_and_button_namespace.md
Last active February 6, 2023 16:40
Organized list of LIRC button names

lirc -- keys & buttons namespace

The list was obtained using the following command...

# irrecord --list-namespace

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

@unforgiven512
unforgiven512 / README.md
Last active February 7, 2023 06:20
UCF file for Digilent Xilinx CoolRunner-II CPLD Starter Board

User Constraints File for Digilent CoolRunner-II CPLD Starter Board

This is intended to be a complete and ready-to-use user constraints file for the [Digilent CoolRunner-II CPLD Starter Board][1] to ease the creation of projects within the Xilinx ISE software.

Hardware Interface Overview

Below is a list of the high-level I/O components featured on the board:

  • LEDs - 4