Today in Programming: MakeCode and Python
Python
A user of my Extra Life Donation Tracker program discovered that I had introduced a regression for brand new users who didn’t have a persistent setting. I thought about it overnight and it was exactly what I thought it would be - when I switched away from threading for the GUI, I forgot to add a way to tell participant.py to reload its settings values. I also decided to take a page from a programming podcast I heard recently and change the settings GUI to only have a “Save” button instead of a persistent save button AND a Save button. Especially when I wanted most people to hit persistent save, and that’s not what they’d most likely do by default. So I ended up making 5.2 release to fix both of those issues.
Last Few Days in Programming: Python and Arduino
Python
Spent the last few days finalizing the 5.0 release of my Extra Life Donation Tracker and then pushed ahead to get version 5.1 out. Here’s the PyPi page if you want to use it for your Extra Life live streams.
Arduino
I got back to my BBQ Themostat project and did some minor programming while trying to figure out how to run a computer case fan. So far I’m still working on the wiring aspect of this part of the project, but some folks on reddit did point out that part of my problem was getting a pair of my BJT connections mixed up.
Today in Programming: Microsoft MakeCode
With the twins, I messed around with a Neopixel strip. Not sure what I’d do with one in a future project, but at least I know how to program it in MakeCode now. Our project:
Messing around with the Neopixels Strip
Today in Programming: Microsoft MakeCode
Since I’ve been making a lot of great progress programming with the kids in Scratch, I bought some Circuit Playground Expresses to program with the kids. The Circuit Playground Express can program in Arduino’s C dialect, CircuitPython, or Microsoft MakeCode, which uses blocks like Scratch. Today Scarlett and I made our first useful bit of code, a digital spinner we called The Sibling Chooser. Here’s the code, and you can see that it is indeed like Scratch:
Setting up my Raspberry Pi Zero W for the Pimoroni Enviro Mini pHAT
As I mentioned before, I got a Raspberry Pi Zero W to replace my Arduino MKR WIFI 1010 and ENV board in the bathroom. My Pimoroni Enviro Mini pHAT (or bonnet, as Adafruit calls them) finally arrived a few days ago, so I setup a git repository for my code. The Pimoroni git Enviro+/Enviro Mini repository has a one-line configuration, but I’d rather do things manually so I know what I’m doing and also so I can set up a proper requirements.txt in my Python venv.
Today in Programming: Python
I noticed that something had gone screwy with the Raspberry Pi 1B in the garage that was monitoring the garage door. I restarted it and discovered that last time I was coding and working on making it more robust if it had a temporary lapse in WiFi (so it wouldn’t crash), I’d created a little error. Fixing that error led me to realize that my new code for robustness had introduced an unfortunate artifact in that it would pass a status of “unchanged” to MQTT. So I fixed that. Code’s now in a good place. I just need to add a few more config options to make it more usable for others who aren’t me. Then I’ll make another release.
Vivaldi on Windows Part 2 (plus a teeny bit about Vivaldi on Linux)
I’ve been using Vivaldi as my default browser for about a week now. As I said in the penultimate paragraph of the post where I mentioned exploring various browsers, I don’t really use my browser on Windows for much more than uploading YouTube videos. And I mentioned last time that it wasn’t the best setup when squished to a half 1080p Window while trying to upload YouTube videos with the tabs on the right. I also had to close the bar on the left. Here’s what that looks like:
Today in Programming: Python and Scratch
Scratch
Once again I worked on some Scratch projects with the kids. This time it involved a sports theme. I let the kids choose which games they wanted to create and Sam chose to create the game where Scratch the Cat goes Skiing.
Having done this for a few weeks now, it wasn’t too much trouble to get things working and do a mod or two for Sam. The video below contains the code and a short video of Sam playing the game.
Upgrading main computer (Supermario) to Fedora 32
It’s been about a month since Fedora 32 was released, so I decided to try and upgrade Supermario to Fedora 32. First I had to disable the dropbox repo since they don’t have a Fedora 32 binary yet. Other conflicts included:
- bat in module
- gimp in module
- meson in module
- ninja in module
- pythnon3-pytest-testmon (doesn’t belong in a distupgrade repo)
- python2-beautifulsoup neds python2-lxml
The python ones are no-brainer to me. I use virtual environments now so I don’t care about the system libraries. I can get rid of those.
Raspberry Pi Zero W for new Projects
The next project I wanted to work on was to see if maybe my environment monitoring might be slightly more reliable with a Raspberry Pi than with an Arduino. So I wanted to do some comparisons. For my bathroom IoT project, I am using:
- Arduinio MKR Wif i 1010 - $32.10
- Arduino MKR ENV Shield - $34.40
- 5V 2.5A power supply - $7.50
That’s a total of $74 before taxes and shipping. To get the same measurements on the Pi platform I went with: