Archive for November, 2007

ARRR-duino

ArduinoSo I finally bit the bullet and bought myself an ARRR-duino (arduino.cc) from a nice little shop called Little Bird Electronics, which by the way has a really cool design in comparison to other webshops. Even though I already have an AVR development platform (the wonderful STK500), it will be nice to have a simple, no extras needed dev kit with USB support. I know USB is complex and all, but dev kit makers, you are still living in the dark ages. My recent computer breakdown decision to upgrade meant it was time for a QuadCore processor. For this, I needed a motherboard upgrade as well. Props to Murphy’s Law, because my new motherboard has no COM ports.

I’m also pleased that this thing gets its power over USB. There is no need to lug a chunky power brick wherever you take it. So I can make little projects and just plug it into my iPod charger (which I take with me anyway) to power it up. Brilliant.

Now I just have to work out how to program it from my iPod Touch…

Picture copyright Pip 2007

Tengu Time!

The Tengu is simply a small LED matrix hooked up to a microcontroller and a electret microphone. The cool part comes in when playing music; the Tengu appears to be lip-syncing. After seeing just what it can do, I knew I needed to have one. But why buy one when you can make it yourself?

It was actually surprisingly easy to drive the LED matrix. The ‘faces’ are stored as eight chars; one for each line of the matrix. Basic code follows:

/* This file assumes that the NPN-transistors are hooked up to PORTB and the cathodes are connected to PORTD */
#include <avr/io.h>
void output_matrix (unsigned char matrix[8]);
unsigned char mouth_closed[] = 		{0x00, 0x66, 0x66, 0x00, 0x7E, 0x00, 0x00, 0x00};
unsigned char mouth_pursed[] = 		{0x00, 0x66, 0x66, 0x00, 0x7E, 0x7E, 0x00, 0x00};
unsigned char mouth_open[] = 		{0x00, 0x66, 0x66, 0x00, 0x7E, 0x81, 0x7E, 0x00};
unsigned char mouth_large[] = 		{0x00, 0x66, 0x66, 0x00, 0x7E, 0x81, 0x81, 0x7E};
unsigned char mouth_big_smile[] = 	{0x00, 0x66, 0x66, 0x00, 0x7E, 0x42, 0x42, 0x3C};
unsigned char mouth_smile[] = 		{0x00, 0x66, 0x66, 0x00, 0x42, 0x42, 0x3C, 0x00};
unsigned char mouth_surprise[] = 	{0x00, 0x66, 0x66, 0x00, 0x7E, 0x42, 0x42, 0x7E};
 
int main (void)
{
 DDRB = 0xFF;
 DDRD = 0xFF; /* Ports are all output */
while (1)
 {
 	output_matrix(mouth_open); /* Forever print the face */
 }
return 0;
}
 
void output_matrix (unsigned char matrix[8])
{
 int x; /* Loop control variable */
for (x = 0; x < 8; x++) { /* For each LED in the array */
 	PORTB = (1 << x); /* Turn on the NPN connected to the 'x' row */
 	PORTD = matrix[x]; /* Output data */
 }
}

I haven’t yet been able to test it with a microphone because my new motherboard does not have any COM ports, so I can’t program any of my AVRs on my STK500. But cables are coming in from eBay soon, so I should have it running sometime in the near future (maybe even make some PCBs!).

Reading comic books on the iPhone/iPod Touch

Note: There is a new native version of jComix here. This page is depreciated.
So I mentioned it before, and I’ve finally got around to releasing a beta version of jComix. Jump on the page here or just click the jComix tab at the top of this blog!

LaTeX + LyX = super mathematical fun-ness

A few days ago, I set out to write the all the definitions required for my physics exam in one location. I didn’t want to do them by hand (so I could share it with other people), but Word the usual suspect pretty much sucks at equations. At first, I discovered the intuitive Tomboy Notes program for Linux. It was great, and there was a LaTeX (TeX is a typesetting language; LaTeX is an extension of it) plugin for it too. Alas though, it was very crashy, and the equations could not be exported as images. So I rang up my super internets friend (google) and found LyX.

LyX is a TeX editor for someone who just wants to get their work done and not faff around in the niceties of TeX. Don’t get me wrong, TeX is powerful and all, but it really is overcomplicated for something this small. It runs on Windows, Linux and MacOSX and exports to PDF, so using it was a win-win situation!

I hate to say it, but the language is actually intuative. Want to square root 3? \sqrt{3} in LaTeX will do that. Need to use greek letters like rho and delta? No problem, \rho and \delta should do the trick. The best part of the language is fractions. Simply typing \frac{1}{2} will give you a fraction of 1/2 (perhaps I should get TeX going in wordpress…).

Well, my physics sheet turned out just fine. If anyone wants to see it (it has information on circular and simple harmonic motion, large scale gravitation and impulse/momentum) you can find it here.