Building A Pocket Sized Python Playground

Like many of us, [Ramin Assadollahi] has a certain fondness for the computers of yesteryear. Finding his itch for nearly instant boot times and bare metal programming weren’t being adequately scratched by any of his modern devices, he decided to build the PortablePy: a pocket-sized device that can drop him directly into a Python prompt wherever and whenever the urge hits him.

The device is powered by the Adafruit PyPortal Titano, which combines a ATSAMD51J20, ESP32, an array of sensors, and a 3.5″ diagonal 320 x 480 color TFT into one turn-key unit. The PyPortal is designed to run CircuitPython, but the scripts are usually dropped on the device over USB. That’s fine for most applications, but [Ramin] wanted his portable to be usable without the need for a host computer.

For a truly mobile experience, he had to figure out a way to bang out some Python code on the device itself. The answer ended up being the M5Stack CardKB, a tiny QWERTY board that communicates over I2C. Once he verified the concept was sound, he wrote a simple file management application and minimal Python editor that could run right on the PyPortal.

The final step was packaging the whole thing up into something he could actually take off the bench. He designed a 3D printed clamshell case inspired by the classic Game Boy Advance SP, making sure to leave enough room in the bottom half to pack in a charging board and LiPo pouch battery. He did have to remove some of the connectors from the back of the PyPortal to get everything to fit inside the case, but the compact final result seems worth the effort.

While an overall success, [Ramin] notes there are a few lingering issues. For one thing, the keyboard is literally a pain to type on. He’s considering building a custom keyboard with softer buttons, but it’s a long-term goal. More immediately he’s focusing on improving the software side of things so its easier to write code and manage multiple files.

It sounds like [Ramin] isn’t looking to compromise on his goal of making the PortablePy completely standalone, but if your convictions aren’t as strong, you could always connect a device like this up to your mobile to make things a bit easier.

Continue reading “Building A Pocket Sized Python Playground”

Ghost Frame Shows People (and Cats) That Don’t Exist

[Dan]’s project from last year slipped past us until now, but his Ghost Frame is a great example of tying some modern hackable hardware together with online resources into a clean result, and we like the clear idea behind it. The Ghost Frame is so named because its purpose is literally to show pictures of people (and cats) that do not exist in the physical world.

This cat does not exist (thank goodness.) The computer doesn’t always get it right.

To make it all work, [Dan] used an Adafruit PyPortal as the guts of the device. It pulls images from ThisPersonDoesNotExist.com (which displays computer-assembled images of faces that do not represent actual living people) and displays them as though they were pictures in a digital photo frame. Formatting the image to show up nicely on the PyPortal’s 320 x 240 display took a little extra work; [Dan] solved that problem with a small PHP script to convert the image to a bitmap and scale it correctly in the process. The PyPortal makes fetching resources from the web simple, so this kind of fiddling didn’t present much of an obstacle to [Dan]’s artistic vision.

What about the cats? Well, it turns out that ThisCatDoesNotExist.com is also out there, and Ghost Frame can happily display computer-generated images of nonexistent cats as easily as it shows imaginary people. However, it does seem that the state of nonexistent cat generation is lagging somewhat behind that for people. The site usually gets it right, but results are occasionally (amusingly) bizarre as you can see here.

The PyPortal is perfect for this kind of project, and it can do more than just display static content. It has some GUI functionality baked in, as we saw showcased recently in this touchscreen Blackjack game.

Blackjack Game Plays With The Limits Of PyPortal

It’s that time of year again, when fall is quickly ushered out to make room for all things holiday-related. For many of us, this means going on trips to visit relatives, which, depending on the relatives, can mean soul-crushing boredom. [Andy] has fun relatives who frequent the casino tables, and they inspired him to brush up on his blackjack game.

Some people would just find a virtual blackjack table or bust out an actual deck of cards to practice, but this is Hackaday. [Andy] busted out his PyPortal and tried his hand at making a blackjack game. The PyPortal is an Adafruit IoT box that makes it easy to scrape and display all kinds of JSON goodness from around the web, like NASA’s image of the day. GUI building is already baked in, so he just needed some oome open source playing card images and he was off.

The real gamble here might be the code he wrote; at 500+ lines, [Andy]’s probably pushing his luck with the PyPortal. But you know what they say — you can’t win if you don’t play. And if you want to improve your odds of winning, teach a robot to count cards for you.

Thanks for the tip, [foamyguy].

A Friendly Reminder That You Might Be In Danger

Product recalls are one of those things that most people don’t pay attention to until things get really bad. If it’s serious enough for somebody to get hurt or even die, then the media will pick it up, but most of the time they simply pass by in silence. In fact, there’s a decent chance that you own a recalled product and don’t even know it. After all, it’s not like anyone is actually watching the latest product recalls in real-time.

Well actually, there might be one guy. [Andrew Kleindolph] has created a cute and cuddly gadget using CircuitPython on the Adafruit PyPortal to display the latest release from the United States Consumer Product Safety Commission (USCPSC). In a wonderfully ironic touch, the child’s unicorn boot that the device lives in is itself a recalled product; apparently kids could pull off the “horn” and choke on it.

The PyPortal is basically built for this kind of thing, allowing you to easily whip up a display that will scrape data from whatever online source you’re willing to write the code for. All [Andrew] had to do was pair it with a battery so the boot could go mobile occasionally (we’re told they’re made for walkin’), and design some 3D printed accoutrements such as a screen bezel and charging port.

As these recalls (thankfully) don’t come out quite so fast that you need it to update more than once or twice a week, it seems like this could also be an excellent application for an Internet-connected e-ink display.