Minimus Pin Functions

Posted on 2012-02-13 in misc

Minimus Pin Functions

Whipped up this quick cheat sheet with all the different functions each minimus pin can perform.


Speak and Spell - Keyboard Matrix

Posted on 2011-01-27 in misc

Speak and Spell

Tonight i spent some time at Hackspace Manchester reverse engineering the keyboard matrix on our speak and spell, in preparation for hooking it up to an MBED.  Since nobody else has released this information (as far as i can tell), here is the pinout:

pin 3 4 5 6 7 8 9 10
1 u k off a f ? p z
2 v l go b g & q `
11 w m < c h ??? r #
12 x n " d i :) s /
13 y o _ e j on t return

This means that when the 'off' button is pressed, for example, pin 1 and pin 5 will be connected together.

To read a matrix keyboard like this, we write some code that steps through the 'down' set of pins (1, 2, 11, 12, 13), holding them low one at a time, then checks each of the other pins (3-10) to see if anything is being held low. If so, we perform a lookup on the table above.


AVR GCC Bit Manipulation Macros

Posted on 2008-07-27 in misc

These are some macros i originally found on avrfreaks for bit manipulation. I have posted them here in case they are useful to anyone.

1
2
3
4
5
6
7
#define bit_get(p,m) ((p) & (m))
#define bit_set(p,m) ((p) |= (m))
#define bit_clear(p,m) ((p) &= \~(m))
#define bit_flip(p,m) ((p) \^= (m))
#define bit_write(c,p,m) (c ? bit_set(p,m) : bit_clear(p,m))
#define BIT(x) (0x01 << (x))
#define LONGBIT(x) ((unsigned long)0x00000001 << (x))

SQL Fun

Posted on 2006-02-10 in misc

Had a bit of fun today, trying to pick out only singleton entries from a database table, finding the lowest unique bid for the reverse auction app i'm doing at work. this is what i came up with:

1
2
3
4
5
6
7
SELECT *
FROM bids
WHERE auction_id = 1
GROUP BY value
HAVING ( COUNT( value ) =1 )
ORDER BY value ASC
LIMIT 1;