Nokia 6100 Library font fix

Hi guys,

I picked up a 6100 LCD Breakout Board a few days ago, and with the help of this handy thread managed to get it working nicely, using the library available here.

The text display was an issue though, with the letters coming out a bit stretched and ugly looking.

This was apparently a side effect of fixing the distorted text displayed.

I think I’ve solved this, and have managed to get nicely formatted text displayed on my screen (left before, right after) by mashing up the existing draw_text_line code with a bit of James Lynch’s wizardry.

So if you are having troubles with stretchy text like the above, give this a go and see if it works for you -

void NokiaLCD::draw_text_line(word fcolor, word bcolor, byte x, byte y, char c) {
	word output0, output1;
	for(unsigned int i=0;i<8;i++) {
		// Create a bit mask, and apply it
		if (1<<i & c) {
			output0 = fcolor;
		} else {
			output0 = bcolor;
		// Move the bit mask on, do the next pixel.
		if (1<<i & c) {
			output1 = fcolor;
		} else {
			output1 = bcolor;
		sendData((output0 >> 4) & 0xFF);
		sendData(((output0 & 0xF) << 4) | ((output1 >> 8) & 0xF));
		sendData(output1 & 0xFF);

Now to sort out the contrast. Is black supposed to be blue?