Skip to content

Instantly share code, notes, and snippets.

Avatar

Mike McGurrin ViennaMike

View GitHub Profile
@ViennaMike
ViennaMike / rcvpitch.py
Last active May 5, 2021
Simple wireless microphone with sound effects using UDP, python, and PyAudio
View rcvpitch.py
import socket
import sys
import pyaudio
import wave # do we need?
import time
import numpy as np
import sox
HOST = '' # Symbolic name meaning all available interfaces
PORT = 50007 # Arbitrary non-privileged port
@ViennaMike
ViennaMike / YorickMaestro.txt
Created Jun 22, 2020
The Maestro Servo Controller script file to control the skull movements (nod, tilt, turn, eye movement) for the Alexa Yorick project (https://www.mcgurrin.info/robots/409/)
View YorickMaestro.txt
begin
9 get_position # get the value of the red trigger, 0-255
155 greater_than # test whether it is greater than 155 -> 1 if true, 0 if false
if
wake
750 delay
1 # flag for getting out of loop
begin
dup
while
@ViennaMike
ViennaMike / Buffalo Hunter.py
Created May 8, 2018
Checks nearest Virginia ABC stores for Buffalo Trace bourbon inventory, sends text message if any is in stock.
View Buffalo Hunter.py
import logging
import datetime
import time
# from bs4 import BeautifulSoup
from selenium import webdriver
from twilio.rest import Client
accountSID='SID Here'
authToken = 'token here'
stores = {'219': 'Old Courthouse' , '231': 'Maple Ave.'}
@ViennaMike
ViennaMike / compass_calibrate.py
Created Apr 29, 2018
Calibration Program for LMS303 3-axis accelerometer and magnetometer, Written in python 2.7. Uses adafruit_lsm303.mpy module to interface with the sensot.
View compass_calibrate.py
# Simple calibration program using the LSM303 accelerometer & magnetometer library.
# Will print the max accelerometer & magnetometer X, Y, Z axis values every
# 1/10th of a second.
# Author: Mike McGurrin, combining code from Tony DiCola and Pololu,
# with additional concepts from https://appelsiini.net/2018/calibrate-magnetometer/
# License: Follows Pololu license (other code was public domain):
# Portions Copyright (c) 2013 Pololu Corporation. For more information, see
#http://www.pololu.com/
#http://forum.pololu.com/
@ViennaMike
ViennaMike / callablenotesanalysis.py
Created Apr 17, 2016
Generate monthly resample data from daily close of S&P and Russell 2000, then compute 12 month rolling forward window and lowest value in window vs. opening
View callablenotesanalysis.py
# -*- coding: utf-8 -*-
"""
Opens previously downloaded historical daily closing values for
S&P 500 and Russell 2000, computes 12 month window lows versus
opening price for the 12 months. Processes month by month, and also computes
monthly open, close, high, low.
For use in analyzing Callable Yield Notes
Created on Mon Apr 11 23:13:15 2016