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 / http-request.ino
Last active January 9, 2018 19:23
Arduino -> Adafruit IO HTTP request
// using the Adafruit Feather M0 ATWINC1500 board
#if !defined(ARDUINO_SAMD_MKR1000) && defined(ARDUINO_ARCH_SAMD)
#define FEATHER_ATWINC1500
#include <SPI.h>
#include <WiFi101.h>
WiFiSSLClient *http_client = new WiFiSSLClient;
#endif // ATWINC1500
// Adafruit IO Publish 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 / wiced-two-feeds.ino
Last active January 16, 2018 22:15
Two Feed Subscriptions
#define IO_SERVER "io.adafruit.com"
#define IO_SERVERPORT 1883 // use 8883 for SSL
#define IO_USERNAME "$$$"
#define IO_KEY "$$$"
#define WIFI_SSID "$$$"
#define WIFI_PASS "$$$"
// indicator
#define PIN 15
// Adafruit IO Digital Input Example
// Tutorial Link: https://learn.adafruit.com/adafruit-io-basics-digital-input
//
// 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.
// Adafruit IO Group Publish Test
//
// 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 / code-and-coffee.sh
Last active February 22, 2018 23:08
FEB 2018 code-and-coffee
#!/usr/bin/env bash
echo -e "\e[93m"
echo " _ _ __ __ ";
echo " ___ ___ __| | ___ __ _ _ __ __| | ___ ___ / _|/ _| ___ ___ ";
echo " / __/ _ \ / _\` |/ _ \_____ / _\` | '_ \ / _\` |_____ / __/ _ \| |_| |_ / _ \/ _ \\";
echo " | (_| (_) | (_| | __/_____| (_| | | | | (_| |_____| (_| (_) | _| _| __/ __/";
echo " \___\___/ \__,_|\___| \__,_|_| |_|\__,_| \___\___/|_| |_| \___|\___|";
echo " ";
echo -e "\e[94m"
# CircuitPlaygroundExpress Light Synth
#
# reads a potentiometer from A7, changes NeoPixels
# and audio tone
#
# slide switch turns off sound, button a changes sample
from analogio import AnalogIn
import board
import neopixel
-- conway's game of life
-- by adam b
world = {}
pw = "a"
nw = "b"
function _init()
for y = 1,128 do
@abachman
abachman / m0-ethernet-counter-publish.ino
Created November 14, 2017 15:48
working example of Adafruit IO + MQTT + Ethernet Featherwing
/***************************************************
Adafruit MQTT Library Ethernet 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 Alec Moore
Derived from the code written by Limor Fried/Ladyada for Adafruit Industries.
MIT license, all text above must be included in any redistribution
@abachman
abachman / aphex-001.rb
Created November 7, 2017 23:04
aphex-001
# for Sonic Pi - http://sonic-pi.net/
live_loop :flibble do
set :n, rrand_i(1, 9)
sample :tabla_na, rate: 0.9 / (get[:n] / 2.0), amp: 1.0 / get[:n]
sleep 1.0 / get[:n]
end
live_loop :bass do
use_synth :growl