Monday, 26 January 2015

Arduino boxed


The TV is a Procaster DTV007 with a Video In.

Here are the first results from my previous keyboard rewiring. I've been dying to create some kind of "fake computer" in the 8-bit style, and this is one step towards this goal. I put the keyboard inside a Tactix brand plastic box with adjustable compartments, and connected it to an Arduino.

I don't like the appearance of this plastic all that much, but at least it is quite robust and re-openable.  Cutting the keyboard hole was a bit of a chore, so I cheated and melted rough lines using a soldering iron and then smoothed the edges with a carpet knife.

The Arduino, connected to the keyboard, runs the TVout library. The TVout generates a small resolution video signal, not much better than some LCDs, but in some ways more handy as it only uses 3 pins.

A bit closer up.
The keyboard with a 5x8 matrix uses most of the pins, 5 analog pins are used as digital pins for one matrix direction, whereas pins 2,3,4,5,6,8 & 12 are used for the other direction. (The TVout needs pins 7,9 and 11 for audio. TVout is quite particular about these).

I did not use the available keyboard library because it often seems to mess with whatever else I happen to be doing. So I simply read the 8 input lines each time Arduino sets one of the 5 lines as an INPUT, keeping the others as OUTPUT. The whole setup is largely copied from a ZX Spectrum, as seen from the rough layout below:


The setup does not do anything much as yet, it's bit like a simple typewriter. Let's say a kind of non-mobile Hemingwrite with a ridiculously low memory. The typing feel is pretty good, as the keyboard is of high standard and Arduino does not seem to miss any key presses. I did not make a key repeat, though.

It's not perfect: If I press several keys horizontal and across along the matrix, additional keys covered by the area might be registered. This can fumble rapid operations with SHIFT+key and some other key, depending on their matrix location. I may make a separate switch altogether for the SHIFT.

I'm now thinking of putting a second Arduino inside the box, if the two can be made to communicate. One Arduino could mostly concentrate on handling the keyboard whereas the other would be keeping up the video and some more interesting communications. We'll see...

The Arduino, doing what Arduinos usually do.

No comments:

Post a Comment