Skip to content

Instantly share code, notes, and snippets.

Avatar

Shawn Hymel ShawnHymel

View GitHub Profile
@ShawnHymel
ShawnHymel / tflite_sinewave_training.ipynb
Created Mar 18, 2020
TensorFlow Lite Sinewave Regression Training and Conversion
View tflite_sinewave_training.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View tflite-micro-wake-word-train-04.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View read_msa301_binho.ipynb
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 Feb 25, 2020
Low Cost Arduino DAQ Example
View arduino_msa301_daq.ino
#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 Feb 24, 2020
TensorFlow Lite KissFFT Test
View stop_mono_16k.h
#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 Feb 8, 2020
Mozilla WebThings - ESP8266 Temperature Sensor (Arduino)
View webthings-temperature-node.ino
/**
* Mozilla WebThings BME280 example
* Date: August 25, 2019
* Author: Shawn Hymel
*
* Notes:
* - Install ArduinoJSON latest v5 (not v6!)
* - Install ESPAsyncTCP
*/
View code.py
# 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 Sep 4, 2019
%HOMEPATH%\.platformio\
View boards\yas-0_f070cb.json
{
"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 Mar 14, 2019
Toggle LED Web Server
View buttonserver.py
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 Mar 13, 2019
Firmata Weather Station
View weather.py
import http.client
import time
from pyfirmata import Arduino, util
# Parameters
COM_PORT = 'COM37'
API_KEY = 'BMZ44FSBTE8JANSU'
HOSTNAME = 'api.thingspeak.com'
AREF = 5.0
You can’t perform that action at this time.