Dad Jokes As a Service

Posted on Mon 24 July 2023 in Python • Tagged with python

Everyone loves a good dad joke

... now, if only there were some good dad jokes!

The ICanHazDadJoke site claims to maintain the internet's largest collection of dad jokes. GitHub user CrossNox has made a nice wrapper around their API. Together, this lets you retrieve a random dad joke programmatically.

Why …


Continue reading

Getting a Boolean from any value in Python

Posted on Fri 14 July 2023 in Python • Tagged with python

Getting a Boolean value from any data type

Recently, I was building a webhook that needed to accept and operate on varied data from outside sources. Included in that data were values meant to be Booleans. However, some callers were sending values like "Yes" or "no" or even "-1". I …


Continue reading

Controlling Christmas lights with MQTT

Posted on Thu 02 January 2020 in Making • Tagged with python, arduino, xmas

I'm one of those Clark Griswold kind of guys that totally over-decorates his house. To make my lights more interesting, I've built my own light animation system which I call PiLit.

Of course, all my code is free and open source. Check it out at https://github.com/skypanther/PiLit …


Continue reading

Multiprocessing in Python

Posted on Mon 15 April 2019 in Python • Tagged with python

Modern CPUs typically feature multiple cores, which in some sense is like having multiple computers at your disposal. By default, your Python code will run on one core. But when performance is critical, you can use multiple cores to run operations simultaneously. In this article, I'll walk through how we …


Continue reading

Robovision on our 2019 FRC bot

Posted on Mon 15 April 2019 in OpenCV • Tagged with robotics, opencv, python

Now that our 2019 FRC season is over, I'd like to describe how Team 1518 implemented vision processing on our bot. We set some aggressive goals, which we aimed to achieve by using the the robovision library, OpenCV, and Python on a Jetson TX2. The primary goals of this post …


Continue reading

Introducing Robovision

Posted on Sun 10 March 2019 in OpenCV • Tagged with python, opencv, robotics

The FIRST robotics competition (FRC) challenges high school students to design and build a robot capable of performing multiple challenging tasks. These annual challenges typically involve computer vision components, such as identifying and using reflective markers to locate targets. High school computer science curriculum rarely covers software engineering topics, let …


Continue reading

Publishing to PyPI

Posted on Fri 25 January 2019 in Python • Tagged with python

I recently published my first Python package to PyPI. The guides I found on how to do so were mostly out-of-date and confusing. Of course, PyPI is reportedly coming out with new updates soon and my instructions here will soon be outdated. In any case, here's my take on how …


Continue reading

Raspberry Pi for IoT

Posted on Fri 14 December 2018 in Making, Python • Tagged with raspberry pi, making, python

I gave a presentation to the Buffalo Python meetup group in December. My talk centered around using the Raspberry Pi as a platform for IoT and embedded development. I want to share my presentation and the resources I mentioned here on my blog.

Update I presented an expanded version of …


Continue reading

Getting user input with OpenCV trackbars

Posted on Tue 16 October 2018 in OpenCV • Tagged with opencv, python

Trackbars, or sliders, are a simple way to get user input when working with OpenCV. In this post, I’ll show you how to add trackbars to an OpenCV window, read their values, and use those values in your Python scripts.

Trackbars (sliders) on an OpenCV window

To demonstrate a use for trackbars, we’ll read …


Continue reading

Multiple cameras with a single Raspberry Pi

Posted on Sun 02 September 2018 in Python • Tagged with python, raspberry pi, making

The Arducam Multi Camera Adapter board is a neat accessory for a Raspberry Pi. With it, you can connect multiple cameras to a single Pi. A single board supports up to four cameras. According to Arducam, you can stack up to four boards for a total of 16 cameras on …


Continue reading