Skip to content

Instantly share code, notes, and snippets.

View abachman's full-sized avatar
🙌
good times

Adam Bachman abachman

🙌
good times
View GitHub Profile
@abachman
abachman / adafruit-io-data-OBS-browser-source.html
Created April 26, 2020 18:18
Locally hosted OBS Browser Source html file pulling temp + humidity from my little office weather station
<!DOCTYPE html>
<html>
<head>
<!-- Fontawesome 5! Get it here: https://fontawesome.com/how-to-use/on-the-web/setup/hosting-font-awesome-yourself -->
<link rel="stylesheet" href="css/all.min.css" />
<style>
body {
background: rgba(0, 0, 0);
color: #ffffff;
font-size: 16px;
@abachman
abachman / python-io-image-client.py
Created July 3, 2019 15:56
Publishing Raspberry Pi image data to Adafruit IO from Python
#!/usr/bin/env python
# based on https://github.com/adafruit/io-client-python/blob/master/examples/mqtt_client.py
import io
import time
import os
# Camera setup guide: https://learn.adafruit.com/cloud-cam-connected-raspberry-pi-security-camera/pi-camera-setup
import picamera
import base64
@abachman
abachman / chart.html
Created June 19, 2019 02:50
Adafruit IO public feed data chart
<!doctype html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.css" />
<style>
body {
margin: 0; padding: 0;
@abachman
abachman / download_paged_data.py
Last active July 9, 2021 15:25
Download data in bulk from Adafruit IO
#!/usr/bin/env python
"""
Download all data from a list of Adafruit IO feeds. Change constants in this
file in the CONFIGURATION section before you run the script.
Usage:
$ START="2019-05-01T00:00Z" END="2019-06-01T00:00Z" \
python download_paged_data.py
"""
@abachman
abachman / index.html
Created April 22, 2019 19:10
MICAVIBE style p5.js coding environment
<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha256-3edrmyuQ0w65f8gfBsqowzjJe2iM6n0nKciPUp8y+7E=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.11/lodash.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.min.js"></script>
<script src="support.js"></script>
<script src="sketch.js"></script>
@abachman
abachman / arduino_hearts_processing.ino
Created November 20, 2018 17:24
Arduino ❤️ Processing
/*
Publish from an ESP8266 to a generic TCP server.
This sketch uses the simplest protocol possible
to send numbers over the wire.
*/
#include <ESP8266WiFi.h>
@abachman
abachman / trellis-keyboard.py
Created November 7, 2018 02:08
CircuitPython Trellis M4 Keyboard Demo
# CircuitPython + Trellis M4 Keyboard emulator. Fits in your pocket!
# using https://www.adafruit.com/product/4020
#
# Should work on any PC
import time
import board
import digitalio
from adafruit_hid.keyboard import Keyboard
from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS
@abachman
abachman / tiltpixel.py
Created November 7, 2018 01:51
CircuitPython Trellis M4 pixel tilt drawing demo
# Tiny slow gravitational etch-a-sketch. Press a button to reset.
# using https://github.com/adafruit/Adafruit_CircuitPython_TrellisM4
# and https://www.adafruit.com/product/4020
import time
import board
import busio
import adafruit_adxl34x
import adafruit_trellism4
@abachman
abachman / tiltcolor.py
Created November 7, 2018 01:47
CircuitPython Trellis M4 color tilt demo
# Trellis M4 Sketch
# tilt the board to change the color
# using https://github.com/adafruit/Adafruit_CircuitPython_TrellisM4
# and https://www.adafruit.com/product/4020
import time
import board
import busio
import adafruit_adxl34x
import adafruit_trellism4
@abachman
abachman / adafruitio_02_pubsub.ino
Last active November 3, 2018 02:19
Troubleshooting IO with a very simple publish + subscribe sketch
// Adafruit IO Publish & Subscribe Example
//
// Adafruit invests time and resources providing this open source code.
// Please support Adafruit and open source hardware by purchasing
// products from Adafruit!
//
// Written by Todd Treece for Adafruit Industries
// Copyright (c) 2016 Adafruit Industries
// Licensed under the MIT license.
//