Skip to content

Instantly share code, notes, and snippets.

Avatar
🙌
good times

Adam Bachman abachman

🙌
good times
View GitHub Profile
View colorWiring breakdown.md

pieces you asked about:

// translate the 24 bit color from RGB to the actual
// order used by the LED wiring.  GRB is the most common.
int colorWiring(int c) {
  int red = (c & 0xFF0000) >> 16;
  int green = (c & 0x00FF00) >> 8;
  int blue = (c & 0x0000FF);
  red = gammatable[red];
View textarea-bonanza.rb
#!/usr/bin/env ruby
#
# Demo of the "severe typing lag" layout bug we found.
#
# Things that fix the lag:
# - set textarea width to a non-percentage value
# - set .container grid-template-rows: to anything other than `auto`, e.g.,
# `100vh` or `100%` work; or remove the property
# - set .container height: to a fixed value or remove the property
@abachman
abachman / adafruit-io-data-OBS-browser-source.html
Created Apr 26, 2020
Locally hosted OBS Browser Source html file pulling temp + humidity from my little office weather station
View adafruit-io-data-OBS-browser-source.html
<!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 Jul 3, 2019
Publishing Raspberry Pi image data to Adafruit IO from Python
View python-io-image-client.py
#!/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 Jun 19, 2019
Adafruit IO public feed data chart
View chart.html
<!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 Dec 17, 2019
Download data in bulk from Adafruit IO
View download_paged_data.py
#!/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 Apr 22, 2019
MICAVIBE style p5.js coding environment
View index.html
<!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>
View arduino_hearts_processing.ino
/*
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 Nov 7, 2018
CircuitPython Trellis M4 Keyboard Demo
View trellis-keyboard.py
# 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 Nov 7, 2018
CircuitPython Trellis M4 pixel tilt drawing demo
View tiltpixel.py
# 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
You can’t perform that action at this time.