Skip to content

Instantly share code, notes, and snippets.

View ShawnHymel's full-sized avatar

Shawn Hymel ShawnHymel

View GitHub Profile
@ShawnHymel
ShawnHymel / tflite_sinewave_training.ipynb
Created March 18, 2020 17:42
TensorFlow Lite Sinewave Regression Training and Conversion
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ShawnHymel
ShawnHymel / arduino_msa301_daq.ino
Created February 25, 2020 23:09
Low Cost Arduino DAQ Example
#include <Wire.h>
#include <Adafruit_MSA301.h>
#include <Adafruit_Sensor.h>
Adafruit_MSA301 msa;
void setup() {
// Open serial port
Serial.begin(250000);
@ShawnHymel
ShawnHymel / stop_mono_16k.h
Last active February 24, 2020 15:15
TensorFlow Lite KissFFT Test
#if !defined(STOP_MONO_16K_H)
#define STOP_MONO_16K_H
const int waveform_len = 16000;
const int16_t waveform[] = {
-14, -12, -5, 1, -4, -14, -19, -16, -6, -2, -8, -19, -19, -12, -1, 4, 0, -8, -10, -7, 1, 4, 1, -5, -6, 0, 9, 7, 2, -1, 2, 10, 15, 14, 11, 11, 12, 14, 13, 10, 6, 7, 11, 13, 12, 10, 12, 9, 7, 7, 10, 17, 18, 13, 4, 3, 11, 22, 26, 20, 10, 9, 16, 24, 23, 14, 9, 11, 18, 20, 15, 8, 7, 13, 18, 15, 10, 5, 8, 15, 19, 16, 9, 4, 8, 16, 19, 13, 6, 0, 2, 8, 12, 12, 12, 9, 10, 12, 9, 4, 0, -1, 0, 0, 0, 1, 2, 3, 1, -2, -6, -5, -3, -1, -1, -3, -5, -6, -7, -9, -9, -8, -9, -8, -6, -2, 0, 0, -3, -6, -10, -12, -9, -8, -5, -2, -1, 0, 0, -3, -7, -7, -7, -6, -6, -8, -8, -3, 5, 11, 6, -3, -5, 2, 9, 8, 3, -1, 2, 13, 15, 8, -1, -1, 10, 22, 26, 20, 12, 12, 17, 21, 17, 8, 6, 10, 19, 28, 30, 24, 22, 26, 28, 27, 24, 22, 26, 28, 26, 27, 34, 39, 36, 24, 12, 13, 23, 29, 30, 24, 22, 25, 31, 33, 27, 23, 25, 33, 35, 29, 19, 15, 19, 25, 30, 28, 22, 15, 17, 28, 37, 35, 26, 16, 13, 17, 21, 23, 21, 19, 17, 20, 25, 28, 28, 24, 20, 12, 9
@ShawnHymel
ShawnHymel / webthings-temperature-node.ino
Created February 8, 2020 18:58
Mozilla WebThings - ESP8266 Temperature Sensor (Arduino)
/**
* Mozilla WebThings BME280 example
* Date: August 25, 2019
* Author: Shawn Hymel
*
* Notes:
* - Install ArduinoJSON latest v5 (not v6!)
* - Install ESPAsyncTCP
*/
@ShawnHymel
ShawnHymel / code.py
Created October 28, 2019 18:28
Spoopy Poopy
# Spoopy Poopy
# Makes a farting pumpkin!
# Author: Shawn Hymel
# Date: October 19, 2019
# See pins below to figure out how to connect peripherals
# Tested on Adafruit Feather M0 Express
# License: Beerware - As long as you retain this notice you
# can do whatever you want with this stuff. If we meet some day, and you think
# this stuff is worth it, you can buy me a beer in return.
@ShawnHymel
ShawnHymel / boards\yas-0_f070cb.json
Last active September 4, 2019 23:43
%HOMEPATH%\.platformio\
{
"build": {
"cpu": "cortex-m0",
"extra_flags": "-DSTM32F070xB",
"f_cpu": "48000000L",
"framework_extra_flags": {
"arduino": "-DVECT_TAB_OFFSET=0x2000 -DCUSTOM_STARTUP_FILE"
},
"mcu": "stm32f070cbt6",
"variant": "YAS-0_F070CB"
@ShawnHymel
ShawnHymel / buttonserver.py
Last active March 14, 2019 21:13
Toggle LED Web Server
import BaseHTTPServer
import SocketServer
import RPi.GPIO as GPIO
# LED pin number (GPIO)
LED = 2
# Port number for our server
PORT = 80
@ShawnHymel
ShawnHymel / weather.py
Created March 13, 2019 19:00
Firmata Weather Station
import http.client
import time
from pyfirmata import Arduino, util
# Parameters
COM_PORT = 'COM37'
API_KEY = 'BMZ44FSBTE8JANSU'
HOSTNAME = 'api.thingspeak.com'
AREF = 5.0