Skip to content

Instantly share code, notes, and snippets.

🙌
good times

Adam Bachman abachman

🙌
good times
Block or report user

Report or block abachman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@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
@abachman
abachman / tiltcolor.py
Created Nov 7, 2018
CircuitPython Trellis M4 color tilt demo
View tiltcolor.py
# 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 Nov 3, 2018
Troubleshooting IO with a very simple publish + subscribe sketch
View adafruitio_02_pubsub.ino
// 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.
//
@abachman
abachman / slack-post
Created Sep 10, 2018
slack-post shell script
View slack-post
#!/usr/bin/env bash
###############################################################################
#
# ./slack-post
#
# A script for sending a system message to a channel.
#
# Docs:
#
You can’t perform that action at this time.