Linux Raspberry Pi Yocto

CircuitPython on Raspberry Pi with Yocto

Today I have submitted a pull request to the excellent meta-raspberrypi Yocto layer to add recipes for a variety of CircuitPython packages. Assuming it is merged in, This will make it easy to use CircuitPython and Adafruit hardware on the Raspberry Pi 4, Zero, Zero W, and all other supported models. Update: it has been …

Continue Reading
Android BLE Electronics ESP32 Reverse engineering

Reverse engineering the Tempur-Pedic adjustable base remote control (part 1.5: Patreon + proof-of-life update)

Long time no write! Recently I’ve received an outpouring of interest in this project which has reinvigorated my desire to work on it. To help myself be able to do so, I have started a Patreon: https://www.patreon.com/chrislaplante. For anyone who is interested in this project moving forward, I would appreciate your support! Please note, the …

Continue Reading
Android BLE C++ Electronics ESP32 Reverse engineering

Reverse engineering the Tempur-Pedic adjustable base remote control (part 1)

This is the first in a (probably) three part series. Checkout the code on BitBucket: https://bitbucket.org/MostThingsWeb/temper-bridge/src/master/main/ About a year ago, I decided to upgrade my old spring mattress to a TEMPUR-Contour Elite Breeze and I cannot say enough good things about it. I opted to also get an adjustable base (this one) for it, which …

Continue Reading
Uncategorized

Capturing Vim environment variables from bash scripts

In a recent bash script, I needed to obtain the value of the $VIM environment variable. Vim uses $VIM (as well as $HOME and $VIMRUNTIME) when computing various paths: http://vim.wikia.com/wiki/Open_vimrc_file#Location_of_vimrc. Default value of $VIM It is possible to find the default (fall-back) value for $VIM by inspecting the output of running vim –version. Here’s a …

Continue Reading
Django HTML JavaScript jQuery Python

Emulating nested optgroups in Django Forms

Some motivation Django has a field called ChoiceField¬†which lets you very easily create a <select> dropdown in your forms. A great feature is the ability to transform nested choices into appropriate <optgroup> groups. For instance, the following code: …creates a field that when rendered looks something like this:   The HTML that Django produced looks …

Continue Reading
C++ HTML

Parsing HTML with C++: Revisited

About a year ago I published an article entitled Parsing HTML with C++. It is by far my most popular article (second most popular being this one), and is a top result on Google for queries such as “html c++ parsing”. Nevertheless there is always room for improvement. Today, I present a revisit of the …

Continue Reading
Arduino Electronics Findings

ATmega/ATtiny PWM tutorial

I was planning on writing a beginner’s tutorial for using PWM on raw AVR chips, but I found that Arduino already has a nice guide here:¬†http://arduino.cc/en/Tutorial/SecretsOfArduinoPWM The only change you need to make to their code to use it without the Arduino software is to remove calls to “pinMode”. Do so by using the appropriate …

Continue Reading