Skip to content

Instantly share code, notes, and snippets.

View technobly's full-sized avatar

Brett Walach technobly

View GitHub Profile
@technobly
technobly / SparkCoreWS2801.cpp
Last active April 29, 2018 21:57
SPARK CORE Adafruit_WS2801 LIBRARY & EXAMPLE
//-----------------------------------------------//
// SPARK CORE Adafruit_WS2801 LIBRARY & EXAMPLE //
//===============================================//
// Copy this into a new application at: //
// https://www.spark.io/build and go nuts! //
// Read comments in APPLICATION.CPP section for //
// Hookup details! //
//-----------------------------------------------//
// Technobly / BDub - Jan 9th, 2014 //
//===============================================//
@technobly
technobly / band-select.cpp
Created April 6, 2016 19:18
Electron Cellular Band Select API Example App
#include "application.h"
SYSTEM_MODE(SEMI_AUTOMATIC);
// ALL_LEVEL, TRACE_LEVEL, DEBUG_LEVEL, INFO_LEVEL, WARN_LEVEL, ERROR_LEVEL, PANIC_LEVEL, NO_LOG_LEVEL
//SerialDebugOutput debugOutput(9600, ALL_LEVEL);
void waitForEnter() {
while (!Serial.available()) {
Particle.process();
@technobly
technobly / sparkTCPClientJSONParse.cpp
Last active October 12, 2017 17:13
TCP CLIENT JSON PARSE EXAMPLE
#include "application.h"
/* ================ HTTP ================ */
TCPClient client;
char buffer[1024];
char * http_get(char const * hostname, String path) {
if (client.connect(hostname, 80)) {
client.print("GET ");
@technobly
technobly / electron-wkp.cpp
Created March 26, 2016 23:35
Particle Asset Tracker Wake on Accelerometer bump, sleep after 10 seconds of no motion
// Uncomment for BUILD IDE
// #pragma SPARK_NO_PREPROCESSOR
#include <math.h>
#include "math.h"
#include <ctype.h>
// Particle application functions
#include "application.h"
// If compiling locally, need Adafruit_LIS3DH.cpp/.h and Adafruit_Sensor.h
@technobly
technobly / sparkStepper.cpp
Last active May 5, 2017 22:47
Spark Core Stepper Library
//-----------------------------------------------//
// STEPPER LIBRARY FOR SPARK CORE //
//===============================================//
// Copy this into a new application at: //
// https://www.spark.io/build and go nuts! //
//-----------------------------------------------//
// Technobly / BDub - Jan 2014 //
//===============================================//
/*
@technobly
technobly / sparkLiquidCrystal.cpp
Created January 9, 2014 21:13
LiquidCrystal LIBRARY for SPARK CORE
//-----------------------------------------------//
// LIQUIDCRYSTAL LIBRARY FOR SPARK CORE //
//===============================================//
// Copy this into a new application at: //
// https://www.spark.io/build and go nuts! //
//-----------------------------------------------//
// Technobly / BDub - Jan 2014 //
//===============================================//
@technobly
technobly / electron-ubidots.cpp
Created January 6, 2017 18:32
Electron Ubidots Example
// Author: RWB <https://community.particle.io/users/rwb/activity>
SYSTEM_MODE(SEMI_AUTOMATIC);
//SYSTEM_THREAD(ENABLED);
// This #include statement was automatically added by the Particle IDE.
#include "Ubidots/Ubidots.h"
#define TOKEN "token" // Put here your Ubidots TOKEN
#define DATA_SOURCE_NAME "ElectronSleepNew"
//This serial prints system process via USB incase you need to debug any problems you may be having with the system.
@technobly
technobly / rssi.cpp
Created November 15, 2016 02:21
Wi-Fi RSSI test app
#define DEBUG_SERIAL true
#define MEASUREMENT_INTERVAL 10000
uint32_t lastTime = 0;
int i = 0;
void setup() {
if (DEBUG_SERIAL) Serial.begin(9600);
}
void loop() {

Hi All, Yesterday I got a FTDI (UART to USB) board from unknown manufacturer. I plugged in to the iMac and without a surprise, it was not working. I have tried all the possible combinations, but no luck. Then after some digging in Apple documentation and Google about kext, FTDI and related, I finally made it. Here are the steps:

  1. In order to disable the AppleUSBFTDI.kext extension (From Mac OS X 10.8 there is Apple driver implementation for the FTDI chip).
cd /System/Library/Extensions/IOUSBFamily.kext/Contents/PlugIns
sudo mv AppleUSBFTDI.kext AppleUSBFTDI.disabled
@technobly
technobly / band-select.cpp
Last active September 8, 2016 07:32
Band Selection on the Particle Electron
// COMPILE from firmware/modules $
// make clean all PLATFORM_ID=10 APPDIR=~/code/fw-apps/band-select COMPILE_LTO=n DEBUG_BUILD=y -s program-dfu
//
// NOTE: APPDIR=~/code/fw-apps/band-select can be APP=band-select if that's easier
/* Includes ------------------------------------------------------------------*/
#include "application.h"
#include "cellular_hal.h"
typedef struct {