Skip to content

Instantly share code, notes, and snippets.

View technobly's full-sized avatar

Brett Walach technobly

View GitHub Profile
@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-troubleshooting.cpp
Created April 15, 2016 20:29
Electron Troubleshooting App
// git clone the latest `develop` branch of the `firmware` repo
// COMPILE from firmware/modules $
// make clean all PLATFORM_ID=10 APPDIR=~/code/fw-apps/electron-troubleshooting COMPILE_LTO=n DEBUG_BUILD=y -s program-dfu
//
// NOTE: APPDIR=~/code/fw-apps/electron-troubleshooting can be APP=electron-troubleshooting if that's easier
/* Includes ------------------------------------------------------------------*/
#include "application.h"
#include "cellular_hal.h"
@technobly
technobly / sparkBitBang.cpp
Created January 9, 2014 21:17
Simple Bit-Bang (Direct Port Manipulation) for Spark Core
//-----------------------------------------------
// Simple Bit-Bang Example
//===============================================
// Copy this into a new application at:
// https://www.spark.io/build and go nuts!
//-----------------------------------------------
// Technobly / BDub - Jan 2014
//===============================================
uint16_t pin = D7;
@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 / particle-ping.cpp
Created October 21, 2015 02:30
Particle Photon/Core/P1/Electron Ping PulseIn Example (HC-SR04)
/*
******************************************************************************
* Copyright (c) 2015 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 / Info.md
Last active May 7, 2019 19:10
SMS Test App (with Tinker)
Press a key to run a command:
[l] list unread SMS
[L] list Read SMS
[d] delete SMS (not implemented, but the function is in the code)
[s] send SMS (not implemented, but the function is in the code)
[r] read unread SMS, do not delete or reply
[R] read already read SMS, delete and reply
[a] send an AT command
[h] show this help menu
@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 / cell-locate.cpp
Last active October 23, 2018 18:19
Cellular Locate Test Application
/******************************************************************************
Copyright (c) 2015 Particle Industries, Inc. All rights reserved.
This program 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 program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@technobly
technobly / particle-ping-sound.cpp
Created October 21, 2015 04:14
Particle Photon/Core/P1/Electron Ping PulseIn Example (HC-SR04) with Sound!
/*
******************************************************************************
* Copyright (c) 2015 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 / 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,