Skip to content

Instantly share code, notes, and snippets.

View technobly's full-sized avatar

Brett Walach technobly

View GitHub Profile
@technobly
technobly / bot.js
Last active December 18, 2015 13:28
Added ability to catch websocket errors and detect if bot is alive to latest Turntable.fm API (note this is required if you want to run the autoreconnect.js bot)
// 88888888888 88888888888 8888888888 888b d888 d8888 8888888b. 8888888
// 888 888 888 8888b d8888 d88888 888 Y88b 888
// 888 888 888 88888b.d88888 d88P888 888 888 888
// 888 888 8888888 888Y88888P888 d88P 888 888 d88P 888
// 888 888 888 888 Y888P 888 d88P 888 8888888P" 888
// 888 888 888 888 Y8P 888 d88P 888 888 888
// 888 888 d8b 888 888 " 888 d8888888888 888 888
// 888 888 Y8P 888 888 888 d88P 888 888 8888888
//
// Compiled bot.js for autoreconnect.js example @ https://github.com/alaingilbert/Turntable-API
@technobly
technobly / tempDilutionFilt.cpp
Created January 9, 2014 21:05
Temperature filtering with a 1/16th Dilution Filter for Spark Core
//----------------------------------------------------
// Temperature filtering with a 1/16th Dilution Filter
// BDub 12-21-2013
//
// 1/16th of the new reading gets added to the ongoing
// running total of 16 virtual readings, with a little
// correction for the truncation process. Very fast
// filter for slow 8-bit uC's that don't have multiply
// or divide instructions.
//
@technobly
technobly / sparkTone.cpp
Created January 9, 2014 21:08
Simple Tone Generator for the Spark Core
//-----------------------------------------------//
// SPARK CORE SIMPLE TONE GENERATOR //
//===============================================//
// Copy this into a new application at: //
// https://www.spark.io/build and go nuts! //
//-----------------------------------------------//
// Technobly / BDub - Jan 2014 //
//===============================================//
#define NOTE_B2 4065
@technobly
technobly / sparkBMP085.cpp
Last active January 2, 2016 18:19
BMP085/BMP180 Barometric Pressure + Temp sensor for Spark Core
//-----------------------------------------------------------------
// BMP085/BMP180 Barometric Pressure + Temp sensor for Spark Core
//=================================================================
// Copy this into a new application at:
// https://www.spark.io/build and go nuts!
//-----------------------------------------------------------------
// Technobly / BDub - Jan 2014
//=================================================================
/***************************************************
@technobly
technobly / sparkAssembly1.cpp
Created January 9, 2014 21:36
Intro to Inline Assembly on the Spark Core #1
//--------------------------------------------------
// Intro to Inline Assembly on the Spark Core (WIP)
//==================================================
// Copy this into a new application at:
// https://www.spark.io/build and go nuts!
//--------------------------------------------------
// Technobly / BDub - Jan 2014
//==================================================
uint16_t pin = D0;
@technobly
technobly / sparkMCP23008LCD.cpp
Last active January 3, 2016 11:49
MCP23008 I2C / SPI LCD BACKPACK LIBRARY FOR SPARK COREhttp://www.adafruit.com/products/292
//-----------------------------------------------//
// I2C / SPI LCD BACKPACK LIBRARY FOR SPARK CORE //
//===============================================//
// Copy this into a new application at: //
// https://www.spark.io/build and go nuts! //
// !! Pinouts on line 427 below !! //
//-----------------------------------------------//
// Technobly / BDub - Jan 16th 2014 //
//===============================================//
@technobly
technobly / sparkFastRead.cpp
Created January 23, 2014 06:29
FAST READ EXAMPLE for SPARK CORE
//-----------------------------------------------
// Fast Read Example
//===============================================
// Copy this into a new application at:
// https://www.spark.io/build and go nuts!
//-----------------------------------------------
// Technobly / BDub - Jan 22nd 2014
//===============================================
#pragma GCC diagnostic ignored "-Wunused-value"
@technobly
technobly / SparkPWM.cpp
Created January 8, 2014 08:13
SPARK CORE CUSTOM PWM FREQUENCY EXAMPLE Define your own frequency! PWM Glitch issue fixed!!
//-----------------------------------------------
// SPARK CORE CUSTOM PWM FREQUENCY EXAMPLE
//===============================================
// Define your own frequency below!
// PWM Glitch issue fixed, only sets up PWM once,
// ... thereafter sets duty cycle.
// This allows true 0 - 100% PWM.
// Copy this into a new application at:
// https://www.spark.io/build and go nuts!
//-----------------------------------------------
@technobly
technobly / u260.md
Created March 22, 2016 13:37
Issue 896 U260 Logs (Working)

U260

399.431 AT send      33 "AT+UDNSRN=0,\"www.technobly.com\"\r\n"
   403.502 AT read  +   27 "\r\n+UDNSRN: \"74.208.28.90\"\r\n"
   403.512 AT read OK    6 "\r\nOK\r\n"
0000403543:DEBUG: virtual void TCPClient::stop() (192):_sock -1 closesocket
socketSocket(TCP)
   403.643 AT send      12 "AT+USOCR=6\r\n"
   403.700 AT read  +   13 "\r\n+USOCR: 1\r\n"
@technobly
technobly / g350.md
Last active March 22, 2016 13:38
Issue 896 G350 Logs (Not Working)

G350

 384.847 AT send      33 "AT+UDNSRN=0,\"www.technobly.com\"\r\n"
   386.438 AT read  +   27 "\r\n+UDNSRN: \"74.208.28.90\"\r\n"
   386.448 AT read OK    6 "\r\nOK\r\n"
0000386479:DEBUG: virtual void TCPClient::stop() (192):_sock -1 closesocket
socketSocket(TCP)
   386.579 AT send      12 "AT+USOCR=6\r\n"
   386.666 AT read  +   13 "\r\n+USOCR: 1\r\n"