Python Provides Classic Basic

Back in the late 1970s and early 1980s when you turned on a PC, more often than not, you’d get a Basic prompt. Most people would then load a game from a tape, but if you were inclined to program you could just start writing. [Richpl] wanted that same experience and thus PyBasic was born. Along with some other Github contributors, the system has grown quite a bit and would be a good start at porting classic games or creating a replica vintage computer.

The interpreter lacks specialized hardware-specific features such as sound and graphics, of course, but then again, you could add them. It does have file I/O and also includes some interesting features like an analog of C’s ternary operator.

Continue reading “Python Provides Classic Basic”

Awesome Python Video Tutorials Keep You Motivated

Programming languages are one of those topics that we geeks have some very strong and often rather polarised opinions about. As new concepts in computing are dreamt up, older languages may grow new features, if viable, or get left behind when new upstarts come along and shake things up a bit. This scribe can remember his early days programming embedded systems, and the arguments that ensued when someone came along with a project that required embedded C++ or worse, Java, when we were mostly diehard C programmers. Fast forward a decade or two, and things are way more complicated. So much choice, so much opinion.

So it’s really nice to come across some truly unique and beautifully made Python tutorial videos, that are engaging and fun to watch. Fronted by Canadian actress [Ulka Simone Mohanty] who some may recognise from such lofty titles as the game “Magic: The Gathering Arena” and various films and TV shows, she delivers a dead-pan avatar-like presentation of the most important areas of Python. We were particularly amused by the comment “Loopus Interruptus” as the exception condition iterating off the end of a list. 

Continue reading “Awesome Python Video Tutorials Keep You Motivated”

BFree Brings Intermittent Computing To Python

Generally speaking, we like our computing devices to remain on and active the whole time we’re using them. But there are situations, such as off-grid devices that run on small solar cells, where constant power is by no means a guarantee. That’s where the concept of intermittent computing comes into play, and now thanks to the BFree project, you can develop Python software that persists even when the hardware goes black.

Implemented as a shield that attaches to a Adafruit Metro M0 Express running a modified CircuitPython interpreter, BFree automatically makes “checkpoints” as the user’s code is running so that if the power is unexpectedly cut, it can return the environment to a known-good state instantaneously. The snapshot of the system, including everything from the variables stored in memory to the state of each individual peripheral, is stored on the non-volatile FRAM of the MSP430 microcontroller on the BFree board; meaning even if the power doesn’t come back on for weeks or months, the software will be ready to leap back into action.

In addition to the storage for system checkpoints, the BFree board also includes energy harvesting circuity and connections for a solar panel and large capacitor. Notably, the system has no provision for a traditional battery. You can keep the Metro M0 Express plugged in while developing your code, but once you’re ready to test in the field, the shield is in charge of powering up the system whenever it’s built up enough of a charge.

The product of a collaboration between teams at Northwestern University and Delft University of Technology, BFree is actually an evolution of the battery-free handheld game they developed around this time last year. While that project was used to raise awareness of how intermittent computing works, BFree is clearly a more flexible platform, and is better suited for wider experimentation.

We’ve seen a fair number of devices that store up small amounts of energy over the long term for quick bouts of activity, so we’re very interested to see what the community can come up with when that sort of hardware is combined with software that can be paused until its needed.

Breadboard containing speech synthesis chip

RPi Python Library Has Retro Chiptunes And Speech Covered

The classic SP0256-AL2 speech chip has featured a few times on these pages, and if you’ve not seen the actual part before, you almost certainly have heard the resulting audio output. The latest Python library from prolific retrocomputing enthusiast [Nick Bild] brings the joy of the old chip to the Raspberry Pi platform, with an added extra trick; support for the venerable AY-3-8910 sound generator as well.

The SP0256-AL2 chip generates vaguely recognisable speech using the allophone system. Allophones are kind of like small chunks of speech audio which when reproduced sequentially, result in intelligible phonemes that form the basis of speech. The chip requires an external device to feed it the allophones at a regular rate, which is the job of his Gi-Pi library.

This speech synthesis technology is based on Linear-predictive coding, which is used to implement a human vocal tract model. This is the same coding method utilized by the first generation of GSM digital mobile phones, implementing a system known as Full-Rate. Both an LPC encoder and an LPC decoder are present on the handset. The LPC encoder takes audio in from the user, breaks it into the tiny constituent parts of speech, and then simply sends a code representing the audio block, but not the actual audio. Obviously there are a few more parameters sent as well to adjust the model at the receiving side. The actual decoding side is therefore not all that dissimilar to what the AY-3-8910 and related devices are doing, except you the user have to create the list of audio blocks up-front and feed the chip at the rate it demands.

Continue reading “RPi Python Library Has Retro Chiptunes And Speech Covered”

Espresso maker with added nixie flair

AI Powered Coffee Maker Knows A Bit Too Much About You

People keep warning that Skynet and the great robot uprising is not that far away, what with all this recent AI and machine-learning malarky getting all the attention lately. But we think going straight for a terminator robot army is not a very smart approach, not least due to a lack of subtlety. We think that it’s a much better bet to take over the world one home appliance at a time, and this AI Powered coffee maker might just well be part of that master plan.

Raspberry Pi Zero sitting atop the custom nixie tube driver PCB
PCB stackup with Pi Zero sat atop the driver / PSU PCBs

[Mark Smith] has taken a standard semi-auto espresso maker and jazzed it up a bit, with a sweet bar graph nixie tube the only obvious addition, at least from the front of the unit. Inside, a Raspberry Pi Zero sits atop his own nixie tube hat and associated power supply. The whole assembly is dropped into a 3D printed case and lives snuggled up to the water pump.

The Pi is running a web application written with the excellent Flask framework, and also an additional control application written in python. This allows the user to connect to the machine via Ethernet and see its status. The smarts are in the form of a simple self-grading machine learning algorithm, that takes a time series as an input (in this case when you take your shots of espresso) and after a few weeks of data, is able to make a reasonable prediction as to when you might want it in the future. It then automatically heats up in time for you to use the machine, when you usually do, then cools back down to save energy. No more pointless wandering around to see if the machine is hot enough yet – as you can just check the web page and see from the comfort of your desk.

But that’s not all [Mark] has done. He also improved the temperature control of the water boiler, and added an interlock that prevents the machine from producing a shot until the water temperature is just so. Water level is indicated by the glorious bar graph nixie tube, which also serves a few other user indication duties when appropriate. All in all a pretty sweet build, but we do add a word of caution: If your toaster starts making an unreasonable number of offers of toasted teacakes, give it a wide berth.

Homebrew Sounder Maps The Depths In Depth

For those who like to muck around in boats, there’s enough to worry about without wondering if you’re going to run aground. And there’s really no way to know that other than to work from charts that show you exactly what lies beneath. But what does one do for places where no such charts exist? Easy — make your own homebrew water depth logger.

Thankfully, gone are the days when an able seaman would manually deploy the sounding line and call out the depth to the bottom. [Neumi]’s sounding rig uses an off-the-shelf sonar depth sounder, one with NMEA, or National Marine Electronic Association, output. Combined with a GPS module and an Arduino with an SD card, the rig can keep track not only of how much water is below it, but exactly where the measurement point is. The whole thing is rigged up to an inflatable dinghy which lets it slowly ply the confines of a small marina, working in and out of the nooks and crannies. A bit of Python and matplotlib stitches that data together into a bathymetric map of the harbor, with pretty fine detail. The chart also takes the tides into account, as the water level varies quite a bit over the four hours it takes to gather all the data. See it in action in the video after the hop.

There’s something cool about revealing the mysteries of the deep, even if they’re not that deep. Want to go a little deeper? We’ve seen that before too.

Continue reading “Homebrew Sounder Maps The Depths In Depth”

Yo Dawg, We Heard You Like Retrocomputers

The idea of having software translation programs around to do things like emulate a Super Nintendo on your $3000 gaming computer or, more practically, run x86 software on a new M1 Mac, seems pretty modern since it is so prevalent in the computer world today. The idea of using software like this is in fact much older and easily traces back into the 80s during the era of Commodore and Atari personal computers. Their hardware was actually not too dissimilar, and with a little bit of patience and know-how it’s possible to compile the Commodore 64 kernel on an Atari, with some limitations.

This project comes to us from [unbibium] and was inspired by a recent video he saw where the original Apple computer was emulated on Commodore 64. He took it in a different direction for this build though. The first step was to reformat the C64 code so it would compile on the Atari, which was largely accomplished with a Python script and some manual tweaking. From there he started working on making sure the ROMs would actually run. The memory setups of these two machines are remarkably similar which made this slightly easier, but he needed a few workarounds for a few speed bumps. Finally the cursor and HMIs were configured, and once a few other things were straightened out he has a working system running C64 software on an 8-bit Atari.

Unsurprisingly, there are a few things that aren’t working. There’s no IO besides the keyboard and mouse, and saving and loading programs is not yet possible. However, [unbibium] has made all of his code available on his GitHub page if anyone wants to expand on his work and may also improve upon this project in future builds. If you’re looking for a much easier point-of-entry for emulating Commodore software in the modern era, though, there is a project available to run a C64 from a Raspberry Pi.

Thanks to [Cprossu] for the tip!