Building a word clock with genetic algorithms

Maybe it was a language barrier he ran into, or possibly an inclination to do things the hard and smart way, but we really like [Alessio]’s take on building the display for his word clock. Instead of relying on a pre-designed word layout, he made his own word pattern with a genetic algorithm.

While looking at other word clock builds on the Internet, [Alessio] noticed all the DIY copies used the same pattern of letters as the original QLOCKTWO word clock. There are obvious reasons for this, laziness chief among them, but [Alessio] decided to do one better. Armed with JGAP, he made a 10×10 German language word clock and a 11×11 English language word clock.

[Alessio]’s algorithm takes a list of regular expressions – ‘five past four’ and ‘four five’ are both valid expressions for 4:05 – and combines solutions together for a hopefully optimal solution. One added bonus of [Alessio]’s method is the ability to generate non-square word clocks. On his project page, [Alessio] put up examples for round, triangular, and diamond-shaped word clocks.

[Alessio] ended up building a 10×10 square German language word clock with an Arduino Nano, DS1307 real-time clock, RGB LEDs, and a few shift registers. Very nice work for a custom-designed word clock.

Getting 12 year olds to learn assembly programming

[notch], the mastermind behind Minecraft, is working on a new game. It’s called 0x10c (pronounced ‘trillek’, we think) and promises to teach an entire new generation the joys of assembly programming on a 1980s-era computer.

The setup for the game is nerdy/awesome enough to make [Douglas Adams] blush; a ‘deep sleep core’ was invented in 1988 that attached to the 16-bit computers of the day. This core was big endian, where the DCPU-16 (the computer in the game) was little endian. What was supposed to be a one-year hibernation turned into a 281 Trillion year coma, the Universe is dying, and everyone from 1988 is just waking up.

The game features a fully functional 16-bit CPU that controls every aspect of your spaceship. The specs for the DCPU-16 have been released and there are several emulators available.

Already, a few communities have been set up around the web to discuss how to program the DCPU-16: the official forum of 0x10c, the 0x10c subreddit, and another dedicated to programming the in-game computer. Already there’s a C-like language that compiles executables for the DCPU and a Game of Life implementation.

We know this isn’t a usual Hackaday post. Despite this, we’re fairly certain a good percentage of our readership will be programming a DCPU-16 in the next year. It just might be time to crack the books and learn how to build a compiler and OS. The dragon book (Compilers Principles, Techniques, and Tools, Aho, Sethi, Ullman, 1985) is very good, and [Andy Tanenbaum]’s Operating Systems Design and Implementation is how [Linus Torvalds] got his start.

One more thing: we’re going to be running a contest for the best physical implementation of the DCPU-16 in a few months. We’ll wait until the in-game hardware is nailed down, along with any peripherals [notch] plans to add. Right now the prizes are some HaD schwag, but that may change. Further info with updates pending, but you’re free to start working now.

Putting multitasking on an AVR

[vinod] wanted to familiarize himself with AVR assembly programming, but wanted to do something a little more ambitious than simply blinking an LED. While the completed build does blink a few LEDs, we love that e decided to implement multitasking on his microcontroller.

The program [vinod] came up with uses round robin scheduling to give one of the seven programmed tasks a little bit of compute time every time a timer is triggered. Although it’s extremely simple compared to “real-life” real-time operating systems like VxWorks, it’s still an impressive achievement.

In the video after the break, [vinod] shows off his task-switching with seven LEDs. The white LED is a PWM task, while the six other LEDs are simple toggling tasks  that switch a LED on and off at set intervals independent of each other. This would be hard – if not impossible – to do without some sort of scheduling. Nice work, [vinod].

[Read more…]

Kinect for Windows Resources

Despite having been out for nearly two months, the world has yet to see a decent guide to the Kinect for Windows. While the Xbox and Windows  versions of the Kinect use basically the same hardware, there are subtle but important differences. Thanks to [Matthew Leone] and his awesome summary of developer resources, getting your Kinect project up and running is now a lot easier.

After getting the SDK from the Microsoft Kinect for Windows site, you might want to check out the Microsoft Programming Guide. The Windows Kinect can only be used with Visual Studio, but with that inflexibility comes a few added features. Both versions of the Kinect have a microphone array that allows for determining the direction of a sound source. The Open Source driver has very little support for audio input, but the official Microsoft version has all the APIs for audio capture, source localization, and speech recognition ready to go.

At $250, the Kinect for Windows is a fairly hefty investment. A used Xbox Kinect can be had for around $80, so we’re pretty certain the hacker community is going to steer itself away from the Windows version. Still, if you’re ever paid to develop something for the Kinect you might want the friendly APIs and features not found in the XBox version.

Python PIC useful when attached to a computer

[Richard] sent in a link to the Python controlled microcontroller he’s been working on. Unlike the previous portable Python boards we’ve seen, [Richard] thinks his pyMCU isn’t best used autonomously. This board is meant to be used only when connected to a computer and to serve as a bridge between the digital world of computers and our analog world.

We’ve seen boards running lightweight Python interpreters, but we’re fairly intrigued by the idea of this board only being useful when plugged into a computer. The on-board PIC 16F chip has enough digital, analog and PWM pins to just about any task imaginable, and there’s also a 16-pin LCD display header if you’d like some output with your microcontrollers.

[Richard] says he’s been working with PICs for longer than the Arduino is around, but depending on the level of interest he’ll consider developing an Arduino version of the pyMCU. All we know is that the pyMCU would be awesome to teach electronics and programming to the younglings, and we could certainly find a few more uses for the board when they’re done with it.

Finally, LaTeX in HTML files

Writing a paper in LaTeX will always result in beautiful output, but if you’d like to put that document up on the web you’re limited to two reasonable options: serve the document as a .PDF (with the horrors involves, although Chrome makes things much more palatable), or relying on third-party browser plugins like TeX The World. Now that [Todd Lehman] has finally cooked up a perl script to embed LaTeX in HTML documents, there’s no reason to type e^i*pi + 1 = 0 anymore.

For those not in the know, LaTeX is a document typesetting language that produces beautiful output, usually in PDF form. Unfortunately, when [Tim Berners-Lee] was inventing HTML, he decided to roll his own markup language instead of simply stealing it from [Don Knuth]. Since then, LaTeX aficionados have had to make do with putting TeX snippets into web pages as images or relying on the [; \LaTeX ;] generated from the TeX The World browser extension.

[Todd Lehman]’s perl script generates the PDF of his LaTeX file and pulls out all the weird font and math symbols into PNG files. These PNG files are carefully embedded into the HTML file generated from the normal text pulled from the LaTeX file. It’s a ton of work to get these document systems working correctly, but at least there’s a reasonable way to put good-looking LaTeX on the web now.