Skip to content

Instantly share code, notes, and snippets.

View ViennaMike's full-sized avatar

Mike McGurrin ViennaMike

View GitHub Profile
@ViennaMike
ViennaMike / rcvpitch.py
Last active October 10, 2023 08:29
Simple wireless microphone with sound effects using UDP, python, and PyAudio
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 June 22, 2020 03:08
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/)
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 00:07
Checks nearest Virginia ABC stores for Buffalo Trace bourbon inventory, sends text message if any is in stock.
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 April 29, 2018 20:29
Calibration Program for LMS303 3-axis accelerometer and magnetometer, Written in python 2.7. Uses adafruit_lsm303.mpy module to interface with the sensot.
# 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 April 17, 2016 03:33
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
# -*- 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