[Sprite_TM]‘s Keyboard Plays Snake

Hackaday Prize judge, hacker extraordinaire, and generally awesome dude [Sprite_TM] spends a lot of time at his computer, and that means a lot of time typing on his keyboard. He recently picked up a board with the latest fad in the world of keyboards, a board with individually addressable LEDs. He took this board to work and a colleague jokingly said, ‘You’ve had this keyboard for 24 hours now, and it has a bunch of LEDs and some arrow keys. I’m disappointed you haven’t got Snake running on it yet.” Thus began the quest to put the one game found on all Nokia phones on a keyboard.

The keyboard in question is a Coolermaster Quickfire Rapid-I, a board that’s marketed as having an ARM Cortex CPU. Pulling apart the board, [Sprite] found a bunch of MX Browns, some LEDs, and a 72MHz ARM Cortex-M3 with 127k of Flash and 32k of RAM. That’s an incredible amount of processing power for a keyboard, and after finding the SWD port, [Sprite] attempted to dump the Flash. The security bit was set. There was another way, however.

Coolermaster is actively working on the firmware, killing bugs, adding lighting modes, and putting all these updates on their website. The firmware updater is distributed as an executable with US and EU versions; the EU version has another key. Figuring the only difference between these versions would be the firmware itself, [Sprite] got his hands on both versions, did a binary diff, and found only one 16k block of data at the end of the file was different. There’s the firmware. It was XOR encrypted, but that’s obvious if you know what to look for.

flashdata The firmware wasn’t complete, though; there were jumps to places outside the code [Sprite] had and a large block looked corrupted. There’s another thing you can do with an executable file: run it. With USBPcap running in the background while executing the firmware updater, [Sprite] could read exactly what was happening when the keyboard was updating. With a small executable that gets around the weirdness of the updater, [Sprite] had a backup copy of the keyboard’s firmware. Even if he bricked the keyboard, he could always bring it back to a stock state. It was time to program Snake.

The first part of writing new firmware was finding a place that had some Flash and RAM to store the new code. This wasn’t hard; there was 64k of Flash free and 28K of unused RAM. The calls to the Snake routine were modified from the variables the original firmware had. If, for example, the original keyboard had a call to change the PWM, [Sprite] could change that to the Snake routine.

Snake is fun, but with a huge, powerful ARM in a device that people will just plug into their keyboard, there’s a lot more you can do with a hacked keyboard. Keyloggers and a BadUSB are extremely possible, especially with firmware that can be updated from a computer. To counter that, [Sprite] added the requirement for a physical condition in order to enter Flash mode. Now, the firmware will only update for about 10 seconds after pressing the fn+f key combination.

There’s more to playing Snake on a keyboard; Sprite has also written a new lighting mode, a fluid simulation thingy that will surely annoy anyone who can’t touch type. You can see the videos of that below.

Continue reading “[Sprite_TM]‘s Keyboard Plays Snake”

IcosaLEDron: A 20-Sided Light Up Ball

Tired of balls that are just balls, and not glowing geometric constructions of electronics and wonderment? Get yourself an IcosaLEDron, the latest in Platonic solids loaded up with RGB LEDs.

The folks at Afrit Labs wanted a fun, glowy device that would show off the capabilities of IMUs and MEMS accelerometers. They came up with a ball with a circuit board inside and twenty WS2812B RGB LEDs studded around its circumference

The frame of the ball is simply a set of twenty tessellated triangles that can be folded up during assembly. The outer shell of the ball is again printed in one piece, but fabricated out of transparent NinjaFlex, an extraordinarily odd, squishy, and likely indestructible material.

Inside the IcosaLEDron is a PCB loaded up with an ATMega328p, an accelerometer, a LiPo battery charger, and quite a bit of wiring. Once the ball is assembled and locked down, the squishy outer exterior is installed and turned into a throwable plaything.

If 20 sides and 20 LEDs aren’t enough, how about a an astonishing 386-LED ball that’s animated and knows its orientation? That’s a project from Null Space Labs, and looking at it in person is hypnotic.

via Makezine

Using the ESP8266 as a Web-enabled sensor

A few months ago, the ESP8266 came onto the scene as a cheap way to add WiFi to just about any project that had a spare UART. Since then, a few people have figured out how to get this neat chip running custom firmware, opening the doors to an Internet of Things based around an ESP8266. [Marc] and [Xavi] just wrote up a quick tutorial on how to turn the ESP8266 into a WiFi sensor platform that will relay the state of a GPIO pin to the Internet.

If you’re going to replicate this project, you won’t be using the stock firmware on the ESP. Instead of the stock firmware, [Marc] and [Xavi] are using the Lua-based firmware that allows for access to a few GPIOs on the device and scripting support to make application development easy. To upload this firmware to the ESP, [Marc] and [Xavi] needed a standard FTDI USB to serial converter, a few AT commands through a terminal program, and a few bits of wire.

The circuit [Marc] and [Xavi] ended up demoing for this tutorial is a simple webpage that’s updated every time a button is pressed. This will be installed in the door of their hackerspace in Barcelona, but already they have a great example of the ESP8266 in use.

Cosplaying as HAL 9000

2001: A Space Odyssey is one of the greatest films of all time, but unlike every other masterpiece of SciFi, you’re not going find many people cosplaying as characters from the movie. Going as a monolith to a con would be hilarious, but [jacqueslelezard] had an even better idea in mind: a HAL 9000 costume.

The costume itself is just bits of painted cardboard, shiny material (we’d go with aluminum tape), some black mosquito netting to see out of, and in a stroke of brilliance, a tablet that will display HAL’s unblinking eye to con attendees. If you’re extraordinarily clever, it might be possible to sample lines from the movie and play them through the tablet. This is, unfortunately, the best way to replicate the voice of HAL, at least until someone gets the money to have [Douglas Rain] sit in for some voice work.

The only drawback to the costume is the propensity for the wearer to hit their head on doorways and low thresholds. This problem could be solved simply by increasing the size of the costume, but then you’re back in monolith territory. So, what do you want to be, a murderous computer or a galactic swiss army knife?

A 4-bit Computer From Discrete Transistors

Anyone reading this uses computers, and a few very cool people have built their own computer out of chips, [zaphod] is doing something even cooler over on hackaday.io: he’s building a computer from discrete transistors.

Building a computer from individual components without chips isn’t something new - Minecraft players who aren’t into cheaty command blocks do it all the time, and there have been a few real-life builds that have rocked our socks. [zaphod] is following in this hallowed tradition by building a four-bit computer, complete with CPU, RAM, and ROM from transistors, diodes, resistors, wire, and a lot of solder.

The ROM for the computer is just a bunch of 16 DIP switches and 128 diodes, giving this computer 128 bits of storage. the RAM for this project is a bit of a hack – it’s an Arduino, but that’s only because [zaphod] doesn’t want to solder 640 transistors just yet. This setup does have its advantages, though: the entire contents of memory can be dumped to a computer through a serial monitor. The ALU is a 4-bit ripple-carry adder/subtractor, with plans for a comparison unit that will be responsible for JMP.

The project hasn’t been without its problems – the first design of the demux for the ROM access logic resulted in a jungle of wires, gates, and connections that [zaphod] couldn’t get a usable signal out of because of the limited gate fan-out of his gates. After looking at the problem, [zaphod] decided to look at how real demuxes were constructed, and eventually hit upon the correct way of doing things – inverters and ANDs.

It’s a beautiful project, and something that [zaphod] has been working for months on. He’s getting close to complete, if you don’t count soldering up the RAM, and already has a crude Larson scanner worked out.

Doing Unsafe Things With A Laser Watch

[Pierce Brosnan]-era James Bond had a beautiful Omega wristwatch. Of course as with any Bond gadget, it couldn’t just tell time; it needed to do something else. This watch had a laser, and [Patrick] figured he could replicate this build.

This is apretty normal 1.5W laser diode build, stuffed into a wrist-mountable device that will kill balloons. This is really a watch, though: press a button and this thing will tell time.

In the video below, [Patrick] goes over what damage this watch can do. He manages to pop some black balloons, burn holes in a CD case, light a few matches, cut cellotape, and put tiny burn marks in his wall. The battery won’t last long – just a few minutes – but more than enough to propel [Patrick] into Youtube stardom.

There are no plans or tutorials for the build, but the teardown [Patrick] shows is pretty impressive. To stuff a laser diode, battery, and clock into a watch-sized compartment, [Patrick] needed to turn down the metal buttons to fit everything into his watch case.

Because the comments for this post will invariable fill up with concern trolls, we’re just going to say, yes, this is incredibly unsafe, no one should ever do this, and it probably kills puppies.


Solving Arduino’s stk500_getsync() error

[psgarcha] took a year-old Arduino Uno on an international trip and upon returning found something was wrong. Every time he would try to upload, he would get the dreaded avrdude error, ‘stk500_getsync(): not in sync resp=0×00′. The Rx light would blink a few times during the attempted upload, but the tx light did not. Somehow, something was terribly wrong with the ‘duino, and [psgarcha] dug deep to figure out why.

To test the quality of the Arduino’s serial connection, [psgarcha] performed a loopback test; basically a wire plugged into the Tx and Rx pins of the Arduino. Sending a short message through the serial port showed the problem wasn’t the USB cable, the ATmega16u2 on the ‘duino, or any traces on the board. This would require more thought.

The main reason for the error would then be no communication between the computer and the ‘duino, the wrong COM port selected, the wrong board selected in the Arduino text editor, or timing errors or a corrupt bootloader. The first three errors were now out of the question, leaving timing errors and a corrupt bootloader. Troubleshooting then moved on to ordering a new programmer, and still this didn’t work with the broken Uno.

Frustrated with one of the greatest failures to become an Arduino tinkerer, [psgarcha] took a good, long look at the Uno board. He glanced over to an Arduino Mega board. Something looked different. On the Uno, the resonator had blown off. Problem found, at least.

Replacing the blown part with a hilariously large can crystal oscillator, [psgarcha] was back in business. This isn’t how you would fix 99% of getsync() errors, and it’s difficult imagining a situation where a this part would randomly blow, but if you’re ever looking at a nearly intractable problem, you need to start looking at what really shouldn’t fail.

Resonator my fix (1)

Awesome rework, though.