Tuesday, September 17, 2019

Chiefs Tomahawk Chop with Raspberry Pi

Wanted to cook up a quick and nerdy way to support the Chiefs this year. So I came up with a Raspberry Pi Tomahawk Chop Button using a servo and an arcade button I had laying around.

Code here.

Had to figure out how to slow the servo down a bit. You can see I went the low tech way. Essentially I am rolling through 3 chops to play with the music. I call the music first using another python script so I can return back to the code to run the chop will the song plays. Here is the song script.

See video below for the chop in action. Let's go CHIEFS!!!!!!

Thursday, May 16, 2019

Python NEOPIXEL Google Traffic and Weather LED Strip

Started playing around with the Neopixel library and python on the Raspberry Pi. I usually take a run over lunch break so I wanted a way to get a quick view of the current weather conditions. I have a 60 LED WS2812 strip so I divided the strip up into 15 LED sections.

  • Section 1 - Temperature. Depending on the temperature I wanted to color the 15 LEDs a specific color.
    • temp > 44 and < 80 = Green
    • temp > 79 and < 90 = Yellow
    • temp > 90 = Red
    • temp > 34 and < 45 = Yellow
    • temp < 34 = Red
  • Section 2 - Wind. 
    • wind < 5 = green
    • wind = 5 and < 16 = Yellow
    • wind > 15 = Red
  • Section 3 - Humidity
    • Humidity < 61 = Green
    • humidity > 61 and < 80 = Yellow
    • humidity > 80 = Red
  • Section 4 - Condition
    • If it is not raining - Green
    • If it is raining - Red
I am using the Open Weather Map API. You can sign up for a free account here: https://openweathermap.org/. I setup an infinite while loop that will sleep for 10 minutes between each iteration. I also set it up to only turn the LEDs on between 10AM and 2PM. The API will only be called during these times. I typically take a run around lunch time so no need to keep it on after this. 

Next steps is to add a Traffic API call. I will light the led up based upon my commute time home.

Monday, March 25, 2019

PowerShell Folder Sizes

More of just a place holder for me because I am tired of searching for this everytime I need it. The following powershell will list out all the subfolders for a given root folder with Sizes and last date modified.

The script will dump the data to CSV so you can do whatever you need from there.