Put An ItsyBitsy Zork In Your Pocket

Before computer games had all these fancy graphics, text based games were a very popular genre. Rather than move a character on the screen, you’d type out commands for your player in sentence form which the game would interpret; decades before the “cloud” language processing technology that the likes of Amazon and Google currently use to power their virtual assistants. In some ways the genre was ahead of its time, but it didn’t survive the graphical revolution for home computers. Of course, these games still have some diehard fans out there.

[Dan The Geek] is one such fan. He loves text based adventure games like Zork so much that he wanted to create his own implementation of the core technology that made these games possible all those years ago. But he didn’t want to just do it on this desktop computer, there’s already projects that let you run these classic games on modern hardware. He wanted to see if he could run these classic games on a modern microcontroller, and create a authentic retro experience on a handy portable device.

[Dan] starts by explaining the technology used to make titles like these possible in the days when the wide array of home computer types required a nuanced approach. By separating the story files from the actual interpreter, developers could more easily port the games to various computers. In theory these interpreters, known as “Z-machines”, could be written for any computer that could compile C code, had enough RAM to hold the story, and had a terminal and keyboard. Not exactly the kind of system requirements we’re used to seeing for modern PC games, but it was the 1980’s.

In theory a modern microcontroller will meet these requirements, so [Dan] wanted to create his own Z-machine for one. But rather than “cheat” by using an SD card like previous Arduino Z-machines have, he wanted to see if there was a development board out there that could do it all internally. The answer came in the form of the  Adafruit ItsyBitsy M4 Express, with its 192 kB of RAM and 2 MB of SPI flash.

The Z-machine created by [Dan], which he’s calling A2Z, allows users to run Zork and other compatible interactive text games on the ItsyBitsy without any additional hardware. Just plug the board into your computer and you’ll be able to play the games over the the serial connection. He’s even implemented some retro color schemes to make the experience more authentic, like the blue of the Amiga or Compaq green.

We’ve covered previous projects that brought Zork and friends to the Arduino, your web browser via a virtual Altair 8800, and even some more exotic targets like custom FPGAs. You can play cave adventure, the game that inspired Zork, on the Supercon Badge.

Debugging Arduino Is Painful: This Can Help

If you are used to coding with almost any modern tool except the Arduino IDE, you are probably accustomed to having on-chip debugging. Sometimes having that visibility inside the code makes all the difference for squashing bugs. But for the Arduino, most of us resort to just printing print statements in our code to observe behavior. When the code works, we take the print statements out. [JoaoLopesF] wanted something better. So he created an Arduino library and a desktop application that lets you have a little better window into your program’s execution.

To be honest, it isn’t really a debugger in the way you normally think of it. But it does offer several nice features. The most rudimentary is to provide levels of messaging so you can filter out messages you don’t care about. This is sort of like a server’s log severity system. Some messages are warnings and some are informational, and some are verbose. You can select what messages to see.

In addition, the library timestamps the messages so you can tell how much time elapsed between messages and what function you were in during the message. It can also examine and set global variables that you preconfigure and set watches on variables. It is also possible to call functions from the serial monitor.

Continue reading “Debugging Arduino Is Painful: This Can Help”

Rooting The Amazon Fire TV Cube With An Arduino

Amazon might not be happy about it, but at least part of the success of their Fire TV Stick was due to the large hacking and modification scene that cropped up around the Android-powered device. A quick search on YouTube for “Fire Stick Hack” will bring up a seemingly endless array of videos, some with millions of views, which will show viewers how to install unofficial software on the little media dongle. Now it looks like their latest media device, the Fire TV Cube, is starting to attract the same kind of attention.

The team at [Exploitee.rs] has recently taken the wraps off their research which shows the new Fire TV Cube can be rooted with nothing more than an Arduino and an HDMI cable you’re willing to cut apart. Of course, it’s a bit more complicated than just that, but between the video they’ve provided and their WiKi, it looks like all the information is out there for anyone who wants to crack open their own Cube. Just don’t be surprised if it puts you on the Amazon Naughty List.

The process starts by putting the device’s Amlogic S905Z into Device Firmware Upgrade (DFU) mode, which is done by sending the string “boot@USB” to the board over the HDMI port’s I2C interface. That’s where the HDMI cable comes in: you can cut into one and wire it right up to your Arduino and run the sketch [Exploitee.rs] has provided to send the appropriate command. Of course, if you want to get fancy, you could use an HDMI breakout board instead.

With the board in DFU mode in you gain read and write access to the device’s eMMC flash, but that doesn’t exactly get you in because there’s still secure boot to contend with. But as these things tend to go, the team was able to identify a second exploit which could be used in conjunction with DFU mode to trick the device into disabling signature verification. Now with the ability to run unsigned code on the Fire TV Cube, [Exploitee.rs] implemented fastboot to make it easier to flash their custom rooted firmware images to the hardware.

As with the Fire TV Stick before it, make sure you understand the risks involved when you switch off a device’s security features. They’re often there to protect the end user as much as the manufacturer.

Continue reading “Rooting The Amazon Fire TV Cube With An Arduino”

Pocket Sized Arduino Calculator Makes A Great First Project

We’ve all got calculators on our phones, in our web browsers, and even in the home “assistant” that’s listening in on your conversations all day on the off chance you blurt out a math question is can solve for you. The most hardcore among us might even still have a real calculator kicking around. So in that light, building your own DIY calculator might not seem too exciting. But we can’t deny this Arduino calculator project by [Danko Bertović] would look good sitting on the bench.

In the video after the break, [Danko] walks us through the creation of the calculator, from placing all the through-hole components to writing the code that pulls it all together. Special attention is given to explaining the wiring, making this is a good project for those just getting started on their digital hacking journey. It also helps that the whole thing is put together on perfboard with jumper wires; no PCB fabrication required for this one.

For the user interface, [Danko] is using an array of 17 tactile switches for the keyboard and a very crisp 128×32 I2C OLED display. Beyond the battery, a crystal, and a handful of passive components, that’s about all the support hardware it takes to put this project together. You don’t even need an enclosure: a second piece of perfboard and some standoffs are used to sandwich the battery and fragile wiring inside.

Of course, the star of the show is the ATmega328P microcontroller, which is mounted in a place of honor right under the OLED screen. The chip gets programmed in an Arduino Uno and then transplanted into the calculator, a neat trick if you don’t have a dedicated programmer handy. Given how cheap Arduino clones can be had online, this is becoming a more common practice.

The construction of this calculator reminds us a bit of the DIY Sinclair scientific calculator we looked at over the summer. But if you want to see the peak of homebrew calculator technology, this Raspberry Pi powered build is tough to beat.

Continue reading “Pocket Sized Arduino Calculator Makes A Great First Project”

Arduino Nitrox Analyzer For The Submarine Hacker

For Hackaday readers who don’t spend their free time underwater, nitrox is a blend of nitrogen and oxygen that’s popular with scuba divers. Compared to atmospheric air, nitrox has a higher concentration of oxygen; which not only allows divers to spend more time underwater but also reduces the risk of decompression sickness. Of course when fiddling with the ratio of gases you breathe there’s a not inconsequential risk of dying, so nitrox diving requires special training and equipment to make sure the gas mixture is correct.

Divers can verify the ratio of oxygen to nitrogen in their nitrox tanks with a portable analyzer, though as you might expect, they aren’t exactly cheap. But if you’re confident in your own hacking skills, [Eunjae Im] might have the solution for divers looking to save some cash. He’s come up with an Arduino based nitrox analyzer that can be built for considerably less than the cost of a commercial unit.

Now before you get the torches lit up, we should be clear: ultimately the accuracy, and therefore safety, of this device depends on the quality of the oxygen sensor used. [Eunjae] isn’t suggesting you get a bottom of the barrel sensor for this build, and in fact links to a replacement sensor that’s intended for commercial nitrox analyzers as a way to verify the unit is up to the task. The downside is that the sensor alone runs $80. If you want to go with something cheaper, you do so at your own risk.

With a suitable sensor in hand, the project really boils down to building up an interface and enclosure for it. [Eunjae] is using an Arduino Nano, a 128×64 OLED screen, and a battery inside of a rugged waterproof case. He also added an ADS1115 16 Bit DAC between the oxygen sensor and the Arduino for fast and accurate readings over I2C. With the hardware assembled, calibrating the device is as simple as taking it outside and making sure you get an oxygen reading of 20.9% (the atmospheric normal).

While [Eunjae] is happy with his analyzer on the whole, he does see a few areas which could be improved in future revisions. The case is bulky and rather unattractive, something that could be addressed with a custom 3D printed case (though waterproofing it might be an issue). He also says the only reason he used a 9V alkaline battery was because he had it on hand, a small rechargeable battery pack would be a much more elegant solution.

We’ll go out on a limb and say that most Hackaday readers aren’t avid scuba divers. For better or for worse, we’re the sort of folks who stay in the shallow end of the pool. But when one of our ilk does dip below the waves, they really seem to go all out.

Continue reading “Arduino Nitrox Analyzer For The Submarine Hacker”

Gyro Controlled RGB Blinky Ball Will Light Up Your Life

[James Bruton], from the XRobots YouTube channel is known for his multipart robot and cosplay builds. Occasionally, though, he creates a one-off build. Recently, he created a video showing how to build a LED ball that changes color depending on its movement.

The project is built around a series of 3D printed “arms” around a hollow core, each loaded with a strip of APA102 RGB LEDs. An Arduino Mega reads orientation data from an MPU6050 and changes the color of the LEDs based on that input. Two buttons attached to the Mega modify the way that the LEDs change color. The Mega, MPU6050, battery and power circuitry are mounted in the middle of the ball. The DotStar strips are stuck to the outside of the curved arms and the wiring goes from one end of the DotStar strip, up through the middle column of the ball to the top of the next arm. This means more complicated wiring but allows for easier programming of the LEDs.

Unlike [James’] other projects, this one is a quickie, but it works as a great introduction to programming DotStar LEDs with an Arduino, as well as using an accelerometer and gyro chip. The code and the CAD is up on Github if you want to create your own. [James] has had a few of his projects on the site before; check out his Open Dog project, but there’s also another blinky ball project as well.

Continue reading “Gyro Controlled RGB Blinky Ball Will Light Up Your Life”

This Cup Holder Crystal Ball Tells Your MPG Future

Hybrid vehicles, which combine an eco-friendly electric motor with a gasoline engine for extended range, are becoming more and more common. They’re a transitional technology that delivers most of the advantages of pure electric vehicles, but without the “scary” elements of electric vehicle ownership which are still foreign to consumers such as installing a charger in their home. But one element which hybrids are still lacking is a good method for informing the driver whether they’re running on petroleum or lithium; a way to check at a glance how “green” their driving really is.

[Ben Kolin] and his daughter [Alyssa] have come up with a clever hack that allows retrofitting existing hybrid vehicles with an extremely easy to understand indicator of real-time vehicle efficiency. No confusing graphics or arcade-style bleeps and bloops, just a color-changing orb which lives in the cup holder. An evolved version which takes the form of a smaller “dome light” that sits on the top of the dashboard could be a compelling aftermarket accessory for the hybrid market.

The device, which they are calling the ecOrb, relies on an interesting quirk of hybrid vehicles. The OBD II interface, which is used for diagnostics on modern vehicles, apparently only shows the RPM for the gasoline engine in a hybrid. So if the car is in motion but the OBD port is reporting 0 RPM, the vehicle must be running under electric power.

With a Bluetooth OBD adapter plugged into the car, all [Ben] and [Alyssa] needed was an Arduino Nano clone with a HC-05 module to read the current propulsion mode in real-time. With some fairly simple conditional logic they’re able to control the color of an RGB LED based on what the vehicle is doing: green for driving on electric power, purple for gas power, and red for when the gas engine is at idle (the worst case scenario for a hybrid).

Check out our previous coverage of OBD hacking on the Cadillac ELR hybrid if you’re looking to learn more about what’s possible with this rapidly developing class of vehicle

Continue reading “This Cup Holder Crystal Ball Tells Your MPG Future”