Skip to content

Instantly share code, notes, and snippets.

View unforgiven512's full-sized avatar

Gerad Munsch unforgiven512

View GitHub Profile
@unforgiven512
unforgiven512 / Configuration.h
Last active June 24, 2023 20:22
Marlin configuration for Ender 3 (with SpeedDrive)
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
@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 / 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 / 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 / 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 / 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 / example.py
Created July 18, 2019 21:57
INA219 library (example) for MicroPython
"""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 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 / ssd1306.py
Created July 18, 2019 21:56
old ssd1306.py library file on MicroPython ESP8266 board #7
"""
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