Skip to content

Instantly share code, notes, and snippets.

View technobly's full-sized avatar

Brett Walach technobly

View GitHub Profile
@technobly
technobly / main.c
Created November 17, 2019 21:37
Hadbadge 2019 Heartrate App
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "mach_defines.h"
#include "sdk.h"
#include "gfx_load.h"
#include "cache.h"
@technobly
technobly / steam-machine-kill-switch1.cpp
Created February 24, 2019 23:42
Steam Machine Kill Switch (Simple Version)
/**
* Steam Machine Kill Switch (Simple Version)
* Brett Walach
* 2019-02-24
*
* A0 is wired directly to the gate of a 2N7002 mosfet
* The source of the 2N7002 is connected to GND
* The drain of the 2N7002 is connected to the Steam Machine's power switch
* Computer GND is connected the Xenon's GND
* Computer +5V from a USB port is connected to the Xenon's Li+
@technobly
technobly / hidapi.md
Last active January 25, 2023 14:44
OpenOCD "configure: error: hidapi is required for the CMSIS-DAP" HIDAPI_LIBS

If you are trying to install OpenOCD with CMSIS-DAP support on Mac OS and having trouble, this Gist may be for you :)

This is the typical error if you specifically try to configure OpenOCD for CMSIS-DAP support

checking for HIDAPI... no
checking for HIDAPI... no
checking for HIDAPI... no
checking for LIBFTDI... no
checking for LIBFTDI... no
@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 / electron-low-power-sensor.cpp
Last active May 11, 2018 02:37
Electron Low Power Sensor Example (Read a sensor every hour, publish once per day, deep sleep in-between) Raw
/*
******************************************************************************
* Copyright (c) 2016 Particle Industries, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation, either
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
@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 / photon-relay-shield-cycler.cpp
Created August 11, 2016 03:28
Photon Relay Shield Cycler
int onTime = 30000;
int offTime = 300000;
int cycles = 0;
bool isOn = true;
uint32_t startTime = millis();
int updateOnTime(String command){
onTime = command.toInt();
return onTime;
}
@technobly
technobly / wifi-listen-true.cpp
Created July 20, 2016 21:08
Manually enter and exit listening mode with the D0 pin
// Configure a wifi network with a bogus name or password into the Photon
// Ground D0 to call WiFi.listen(true) while the connection attempt is ongoing
// Open, then Ground D0 again to call WiFi.listen(false)
///
#include "application.h"
SYSTEM_THREAD(ENABLED);
SYSTEM_MODE(AUTOMATIC);
void reconnectAfterListen() {
@technobly
technobly / Pomodoro.cpp
Last active July 6, 2016 16:30
Super simple Pomodoro Timer via the Particle Internet Button!
// This #include statement was automatically added by the Particle IDE.
#include "InternetButton/InternetButton.h"
InternetButton b = InternetButton();
uint32_t workTime = 0;
uint32_t restTime = 0;
// Time definitions in milliseconds