Programming Ada: Packages And Command Line Applications

In the previous installment in this series we looked at how to set up an Ada development environment, and how to compile and run a simple Ada application. Building upon this foundation, we will now look at how to create more complex applications, along with how to parse and use arguments passed to Ada applications on the command line (CLI). After all, passing flags and strings to CLI applications when we launch them is a crucial part of user interaction, as well as when automating systems as is the case with system services.

The way that a program is built-up is also essential, as well-organized code eases maintenance and promotes code reusability through e.g. modularity. In Ada you can organize subprograms (i.e. functions and procedures) in a declarative fashion as stand-alone units, as well as embed subprograms in other subprograms. Another option is packages, which roughly correspond to C++ namespaces, while tagged types are the equivalent of classes. In the previous article we already saw the use of a package, when we used the Ada.Text_IO package to output text to the CLI. In this article we’ll look at how to write our own alongside handling command line input, after a word about the role of the binding phase during the building of an Ada application.

Continue reading “Programming Ada: Packages And Command Line Applications”

This Arduino Is Feeding The Fishes

Depending on the species, a fish can be a fairly low-maintenance pet. But of course even the most laid back of creatures needs to eat, so you’ll have to make sure to feed them regularly. If you’re a fish owner who would like to simplify tending to your creatures, you might find value in this project from [CrazyScience].

This fish feeder is based on an Arduino Uno, the 8-bit microcontroller development board which has done so much for so many. The Arduino drives a stepper motor, which rotates a 3D printed disc mechanism for dispensing food. Each slot of the disc is loaded with a small amount of fish food, so that when it rotates, a slot dumps its contents through a slot into the water.

Activating the system is as easy as a wave of the hand. That’s thanks to an ultrasonic sensor, which detects movement close by, and triggers the food delivery mechanism in turn. We’d love to see this upgraded with a timer mode too, though it would require the addition of a real-time clock module to the humble Arduino Uno.

It’s a simple project, but one that teaches all kinds of useful skills, from programming to design and 3D printing. We just worry that the fish bowl in the demo is a far too small for fish to remain healthy. We’ve seen some other similar projects before, too.

Continue reading “This Arduino Is Feeding The Fishes”

Supercon 2023: Jose Angel Torres On Building A Junkyard Secure Phone

If you ever wondered just what it takes to build a modern device like a phone, you should have come to last year’s Supercon and talked with [Jose Angel Torres]. He’s an engineer whose passion into investigating what makes modern devices tick is undeniable, and he tells us all about where his forays have led so far – discovering marvels that a Western hacker might not be aware of.

Six years ago, he has moved to China, having previously been responsible for making sure that their Chinese subcontractors would manufacture things in the right ways. Turns out, doing that while being separated by an ocean set up more than just the timezone barriers – they were communicating between different worlds.

[Jose] tells us of having learned Chinese on the spot, purely from communicating with people around him, and it’s no wonder he’s had the motivation! What he’s experienced is being at the heart of cycle of hardware life, where devices are manufactured, taken apart and rebuilt anew. Here’s how he tapped into that cycle, and where he’s heading now.

Continue reading “Supercon 2023: Jose Angel Torres On Building A Junkyard Secure Phone”

Pssst… Wanna Buy An Old Supercomputer?

If you spend your time plotting evil world domination while stroking your fluffy white cat in your super-villain lair, it’s clear that only the most high-performance in computing is going to help you achieve your dastardly aims. But computers of that scale are expensive, and not even your tame mad scientist can whistle one out of thin air. Never mind though, because if your life lacks a supercomputer, there’s one for sale right now in Wyoming.

The Cheyenne Supercomputer was ranked in the top 20 of global computing power back in 2016, when it was installed to work on atmospheric simulation and earth sciences. There’s a page containing exhaustive specs, but overall we’re talking about a Silicon Graphics ICE XA system with 8,064 processors at 18 cores each for a total of 14,5152 cores, and a not inconsequential 313,344 GB of memory. In terms of software it ran the SuSE Linux Enterprise Server OS, but don’t let that stop you from installing your distro of choice.

It’s now being sold on a government auction site in a decommissioned but able to be reactivated state, and given that it takes up a LOT of space we’re guessing that arranging the trucks to move it will cost more than the computer itself. If you’re interested it’s standing at a shade over $40,000 at the time of writing with its reserve not met, and you have until the 3rd of May to snag it.

It’s clear that the world of supercomputing is a fast-moving one and this computer has been superseded. So whoever buys it won’t be joining the big boys any time soon — even though it remains one heck of a machine by mere mortal standards. We’re curious then who would buy an old supercomputer, if anyone. Would its power consumption for that much computing make it better off as scrap metal, or is there still a place for it somewhere? Ideas? Air them in the comments.

Cheap Musical Tesla Coil Put Through Its Paces

Once upon a time, musical Tesla coils were something you primarily saw at high-voltage hobby meets. They’ve become more popular in recent years, and now you can even buy cheap examples online. [mircemk] decided to buy one and gave it a whirl.

The device comes with a power supply capable of delivering 2 amps at 48 V.  It’s a solid-state design, relying on SMD MOSFETs to generate high-voltage, high-frequency output that makes the sparks we all know and love. The pancake coil is key to the design, and is made using a trace on the PCB — a neat technique compared to making one with a laborious winding operation.

The coil can be used to simply generate sparks, or it can be modulated musically. In this mode of operation, it’s intended to be driven by square wave audio for simplicity’s sake. As seen in [mircemk]’s video, the sound quality is pretty decent for a cheap device, and the Super Mario theme is readily recognizable. As a guide, he also demonstrates how to drive the device using an Arduino set up for square wave audio output.

If you prefer to build your own singing Tesla coil, you can go that route instead. Or, you could buy one of these and hack it, and drop us a line with what you come up with! Similar devices are all over the ‘net. Continue reading “Cheap Musical Tesla Coil Put Through Its Paces”

Simplest Speaker Oscillator, Now Even Simpler

It never fails. Lay down some kind of superlative — fastest, cheapest, smallest — around this place and someone out there says, “Hold my beer” and gets to work. In this case, it’s another, even simpler audio oscillator, this time with just a loudspeaker and a battery.

Attentive readers will recall the previous title holder was indeed pretty simple, consisting only of the mic and speaker from an old landline telephone handset wired in series with a battery. Seeing this reminded [Hydrogen Time] of a lucky childhood accident while experimenting with a loudspeaker, which he recreates in the video below. The BOM for this one is even smaller than the previous one — just a small speaker and a battery, plus a small scrap of solid hookup wire. The wire is the key; rather than connecting directly to the speaker terminal, it connects to the speaker frame on one end while the other is carefully adjusted to just barely touch the flexible wire penetrating the speaker cone on its way to the voice coil.

When power is applied with the correct polarity, current flows through the wire into the voice coil, which moves the cone and breaks the circuit. The speaker’s diaphragm resets the cone, completing the circuit and repeating the whole process. The loudspeaker makes a little click with each cycle, leading to a very rough-sounding oscillator. [Hydrogen Time] doesn’t put a scope on it, but we suspect the waveform would be a ragged square wave whose frequency depends on the voltage, the spring constant of the diaphragm, and the spacing between the fixed wire and the voice coil lead.

Yes, we realize this is stretching the definition of an audio oscillator somewhat, but you’ve got to admit it’s simple. Can you get it even simpler?

Continue reading “Simplest Speaker Oscillator, Now Even Simpler”

Making Beer Like It’s 1574, For Science And Heritage

Are you interested in the history of beer, food science, or just a fan of gathering “um, actually” details about things? Well you’re in for a treat because FoodCult (exploring Food, Culture, and Identity in early modern Ireland) has a fantastic exhibition showcasing their recreation of beer last brewed in the sixteenth century by putting serious scientific work into it, and learning plenty in the process.

A typical historical beer of middling strength was around 5% alcohol by volume, similar to a modern-day lager.

The recipes, equipment and techniques are straight from what was used at Dublin Castle in the late 1500s. This process yielded very interesting insights about what beer back then was really like, how strong it was, and what was involved in the whole process.

Documentation from the era also provides cultural insight. Beer was often used to as payment and provided a significant amount of dietary energy. Dublin Castle, by the way, consumed some 26,000 gallons per year.

In many ways, beer from back then would be pretty familiar today, but there are differences as well. Chief among them are the ingredients.

While the ingredients themselves are unsurprising in nature, it is in fact impossible to 100% recreate the beer from 1574 for a simple reason: these ingredients no longer exist as they did back then. Nevertheless, the team did an inspired job of getting as close as possible to the historical versions of barley, oats, hops, yeast, and even the water. Continue reading “Making Beer Like It’s 1574, For Science And Heritage”