Thanks for your work! I've just ordered one GLCD 128*64. Waiting right now. Hope to get it to work since it's KS0108 compatible. Is there any way to reduce the data line to 4 bits so I can still sense a few buttons and digital I/O? The GLCD will take 13 pins out of 18 pins (I need to keep serial). There's only 5 pins left. I have 3 buttons and 2 inputs and that leaves no room to expand. Is there any way to sacrifice speed and support shift register for the data bits? Thanks.

The ks0108 does not have a four bit mode so all eight data lines are required. The data is bidirectional (bot read and write). Bidirectional shift register solutions are complicated and it may be easier using a low cost bare bones instead to drive the GLCD that talks to Arduino through somthing like I2C.

Another solution is to use an Arduino compatible board with more pins. The Mega has 54 pins, and thats overkill there are boards with a smaller price and form factor - have a look the Sanguino (32 pins), Teensy (25 IO pins) and the Teensy++ (46 IO pins).

Just my 2 cents, but at this point in time, I don't see the value of the Sanguino now that the Teensy++ is available and PJRC has a teensy plugin for the arduino IDE.

Teensyduino s/w includes re-written digital i/o routines (digitalWrite(), PinMode(), etc...) that are MUCHfaster than the standard libraries provided by Arduino.

Teensy++ board hardware hasDouble the flash, Double the RAM, double the EEPROM, same analog inputs, more PWM pins, Hardware USB support builtin so you can emulate lots of USB devices with simple s/w (PJRC provides lots of sample code), does not need a USB to serial cable (like an FTDI cable) as USB support is built into the AT90USB1286.

It is also quite a bit cheaper than a Sanguino and comes fully assembled and tested.

The Sanguino is usually a kit which can be a plus for some people as it is kind of fun to solder up a board and you can also replace the processor as they are through hole vs SMT.

I really like the hardware USB support especially for virtual serial communication as not only can the virtual serial interface run much faster but also has built in flow control management because it sits on top of USB.

Actually, the Sanguino kit is the same price as the Teensy++ and would be a better choice for applications that need two hardware TTL serial ports (without USB). It's a particularly good choice for hardware hackers - I have a project using the Sanguino circuit (an ATmega644P and a crystal) that was put together for $10 in parts.

That said, the Teensy++ is a good choice for the typical Arduino usage that uses USB connection to a computer.

The library needs to both write and read to the LCD and implementing a read/write shift register a little tricky. For a similar component cost you could probably use a second ATmega168 to run the library code that communicates with a master Arduino via something like I2C. Someone else asked about that capability and if it's a popular request then we can put I2C on the wish list for a future release.

Ive been playing around with code for a few hours and got the nunchuck value to print from 73 to 184 or 185 the same in the serial.At around 130 the value of accx is level.My question is which im completely stumbled on is read a value from accx and depending on which state it is in draw a line (like a tilt plain) from level to be at 0, 32. if tilted to the right itd draw a line from 0,0 to 127,63. if tilted from left itd draw a line from 127,0 to 0,63.

OK, Thanks for answers to my Sanguino question. Is there any place where you can cheaply buy (<US$10) an ATMEGA644 with Sanguino bootloader. I will only need the chip. It seems that this chip needs same support as ATMEGA328P to run duino environment (5V DC, 16MHz crystal, caps etc.) I will need to get serial cable/FTDI chip board for other stuff anyway.

@chris, there is an example for drawing angled lines in the FPS example sketch. If you want to draw lines at a specified angle there is an example in the clockface sketch supplied in the download, although that code is highly optimized (it uses a sin table instead of floating point) and is a little obscure.

If RAM or performance are not a concern then you can use trionometry to calculate the coordinates. If you need it, you can find a trig primer here: http://processing.org/learning/trig/