Nokia 6100 LCD Display - Arduino Playground

The sketch you are using, which works, is pretty easy to convert to a library.
I will give it a try :slight_smile:

@Mike Mc: Installed external libraries? Not really sure :-? I just downloaded the zip file and extracted it to arduino0016/hardware/libraries in a folder, then get all the errors.

@Thomas J: Muchos gracias! I've been trying, based on some of the tutorials for building the libraries but I think I just need more understanding of code ::slight_smile:

I just ordered my 2nd Arduino, and another 328 upgrade chip, along with some 433mhz RF kits, oo lala! :smiley:

Library is finished - and it can compile without problems.
I can't test it though, as I haven't connected my LCD yet, and I don't want to right now!

I will upload the code to my homepage (elec.tkjweb.dk/blog) in a moment...

I thought it would compile fine, but it didn't - my bad :-X
It's made to a correctly library, but you get theese errors when you start Arduino - and I can't solve it myself...

NokiaLCD.cpp:195: error: no 'void NokiaLCD::shiftBits(byte)' member function declared in class 'NokiaLCD'
NokiaLCD.cpp: In member function 'void NokiaLCD::sendData(byte)':
NokiaLCD.cpp:259: error: 'shiftBits' was not declared in this scope
NokiaLCD.cpp: In member function 'void NokiaLCD::sendCMD(byte)':
NokiaLCD.cpp:275: error: 'shiftBits' was not declared in this scope

You can download the library (with example) here: http://elec.tkjweb.dk/blog/wp-content/uploads/NokiaLCD.zip

Omg, haha, you sir.. are amazing!
I looked in the NokiaLCD.h file, and turns out you missed your F in Shift bits on one of the defines.. put in the F and it compiled fine!

Now to start experimenting, thanks again, very much!! I may be asking later how to add commands to the library. :smiley: but for now, need to try!

You're right - I've missed that :stuck_out_tongue:
So, is it working?

I've re-uploaded the working library (with example) here: http://elec.tkjweb.dk/blog/wp-content/uploads/NokiaLCD.zip

Yes! It's working like a champ!
Already have my arduino and the lcd hooked up on a breadboard, so just plugged in, uploaded sketch and badabing bada boom!

I did a quick search, and I'm sure I looked for the wrong thing, but is there a way to turn read values from the board into the spi bits? Or whatever it is I need to input them on the screen?
I'm just looking to do some basic interfacing right now.

If you want to for example take a an Analog read and print it on the screen, you can add this code to the bottom of the example (before the close bracket)

// Put this at the top - just about the void setup()
int analogValue;
char analogString[4]; 

// Put this just before the last closing bracket - just after the nokiaLcd.lcd_clear(BLACK,0,0,131,131);
 analogValue = analogRead(0);
 itoa(analogValue, analogString, 10);
 strcpy(text,analogString);
 nokiaLcd.lcd_draw_text(YELLOW, BLACK, 35, 5, text);

 delay(2000);
 nokiaLcd.lcd_clear(BLACK,0,0,131,131);

Also, please tell me how you connected the display to the Arduino? If you could, please take some pictures of your Arduino and the breadboard!

Awesome, works perfectly, thanks again! Well while I'm posting to such a skilled coder, haha :slight_smile: how do I go about changing the background color?
Now, with the sample sketch, and any time I clear the LCD every 2 seconds or so, the background will stay black when it's displaying the text, but the screen resets every 2 seconds, I'm sure there's an easier way!

And I would take pictures.. haha I just tried and let's just say my pictures aren't worth nearly a thousand words.. :stuck_out_tongue:
I couldn't even make out what half of the stuff was in the picture, haha I tried semi-close and far away, was either too blurry or just too far away.
Though, I will explain how I hooked up the pins! (And be advised, the LCD I purchased has an onboard dc-to-dc booster (lol think thats the right word) where alot of the 6610s need an external power supply.)

Arduino
Digital pin 2: BL (Back Light controller)
Digital pin 3: CS (Chip Select)
Digital pin 4: SCLK (Serial Clock)
Digital pin 5: SDATA (Serial Data)
Digital pin 6: RESET (lol, Reset!)
Arduino 5 Volt : VCC (Power), And VBL(Voltage Booster for 7v backlight)

Woot!
I have a very-ghetto "Etch-a-Sketch" sketch at the moment! Complete with X and Y indicator!

/*
  Nokia LCD Demo - A demo using the NokiaLCD library for a Nokia LCD with the epson driver.
  Created by Thomas Jespersen, July 2009 (Originally Arduino Sketch by Gravitech.us)
  Released into the public domain.
  Edit by CaptainObvious - Ghetto Etch A Sketch
*/

#include <NokiaLCD.h>

// Nokia LCD Setup settings
#define RED                  0xE0
#define GREEN                  0x1C
#define BLUE                  0x03
#define YELLOW                  0xFC
#define MAGENTA                  0xE3
#define CYAN                  0x1F
#define BLACK                  0x00
#define WHITE                  0xFF
NokiaLCD nokiaLcd;

int potPin = 2;    // X Position
int potPin2 = 3;   // Y Position
int lcdDraw = 0;    
int lcdDraw2 = 0;   
char analogString[4];
char analogString2[4];

void setup() 
{ 
  DDRD |= B01111100;   // Set SPI pins as output 
  PORTD |= B01111100;  // Set SPI pins HIGH
  
  nokiaLcd.lcd_init();
  delay(500);
} 
 
void loop() 
{
 char text [50];   // Not 100% sure if this is text size or what
analogRead(potPin);
analogRead(potPin2);

itoa(lcdDraw, analogString, 10);   // Not really sure what itoa is, but it's important! 
itoa(lcdDraw2, analogString2, 10);

strcpy(text, analogString);     // First pot # input, printed in BLUE
nokiaLcd.lcd_draw_text(BLUE, BLACK, 100, 115, text);
strcpy(text, analogString2);    // Second pot # input, printed in RED
nokiaLcd.lcd_draw_text(RED, BLACK, 100, 105, text);

lcdDraw = analogRead(potPin)/8;
lcdDraw2 = analogRead(potPin2)/8;
 
 nokiaLcd.LCD_put_pixel(RED, lcdDraw, lcdDraw2); 

 
}

Will be adding a button to clear screen shortly, and when it shows the position, once it's above 100, 3 Digit spots open, and the last digit is filled with a 0 if it's below 100. So anything that's < 100, will show up as "990" when it should be 99, "420" when it should be 42, etc.
But other than that, I can't thank you enough Thomas!
I'm also hoping to add a menu option, be able to choose etch a sketch or a couple other ideas, but first things first!

Much appreciative,
Captain O!

Well I've been becoming an artist over night! (hardly)

Now I'm stuck with creating a menu, or menus! (And many other things but this feels important) I'm guessing I'll be editing my .cpp and actually code in the screens, I'm just not sure how to use words as input? I guess? Being able to highlight my selection as I scroll up and down. Using either 2 buttons for up and down, 1 for select, or just a potentiometer I'm using for drawing, for a menu selection tool.

I got down how to change the background color of text only, not the background color of the whole LCD. So animating the highlighting would be easy, just coding the selection part is my problem! Not even sure what to ask, or where to begin, hope I got it out right!

Thanks in advance!
:smiley:

Sounds good... Very nice project you've made :slight_smile:
About the connection, don't you need any voltage converter for the different lines? Aren't the display running on 3.3V!
I have a display with voltage booster for the backlight too - Color LCD - Breakout Board - LCD-08600 - SparkFun Electronics

About the backlight color, you can use (change, as it's already in the code) this code line.

nokiaLcd.lcd_clear(BLACK,0,0,131,131);

The lcd_clear command just makes a square box with the color,x1,x2,y1,y2 parameters! I hope you understand that :stuck_out_tongue:

Also, I can see that you don't know what the "itoa" command is.
It's a integer to string command, which converts a integer to a string so it can be used as a char* parameter.
There is also the "atoi" command, which converts a string (char*) with numbers into a integer value.

Sprintf can do the same as both of them, but it use 1.5K of code, while theese only use a couple of bytes :slight_smile:

Actually I have both the BL and VCC connected to 5v. No problems so far, hope I don't damage anything :-X

Well, when I use the lcd_clear command, it does just that, it clears. When I have any information on the screen, it just looks like it's flashing because it keeps looping, and if I put in a delay, it just flashes, but slower. :stuck_out_tongue:

And yes I understand the parameters, I think, haha battle ship! :slight_smile: But minus the letters. As for the itoa, doesn't make too much sense to my noobness at the moment, but slowly but surely everythings making more sense. :slight_smile:

You can change the X1,X2,Y1,Y2 parameter to only clear an area... So if you want to flash the background of only a little area (making a flashing box) you could do this:

nokiaLcd.lcd_clear(BLUE,0,0,10,10);
delay(200);
nokiaLcd.lcd_clear(GREEN,0,0,10,10);
delay(200);

But wouldn't this works for flashing the background of the text?

nokiaLcd.lcd_draw_text(WHITE,BLACK, 100, 105, text);
delay(200);
nokiaLcd.lcd_draw_text(BLACK,WHITE, 100, 105, text);
delay(200);

Also please tell me, is it the same display you have, as I have?

Actually, I have the 6610, I believe the one you're using is the 6600. I read your first post, I have the same controller as yours. Well here, check this website, it has everything I started with lol the newbie code, and there are some amazing PDFs

There's a like 130 page tutorial on how to write code for the LCD driver, but it's just way above my head.

And @ the flashing, I don't want it to flash! haha, I'm just looking for a background color. (I just fixed it, turns out I had the lcd_clear in my loop.. so no wonder it was going to flash really fast)!

Using nokiaLcd.lcd_clear(BLACK, 0, 0, 131, 131);
The background does turn black, but it blinks very fast, not a background.

EDIT:
Oh, ... reading the main reason for this post, lol
When I was hooking up the screen for power, uh, I'm not sure if it would be parallel or series, but I ran 5v to the power rail on the bread board, and spread the power out there, including both the VBL and VCC. And of course, did the same with ground.
When I tried using resistors and even the transistor, I had problems. But I couldn't get anything to show up at all with the tutorial on the Arduino website for the Epson controller.

Your display is a 3.3 to 5V display which is very nice.
You can just connect it directly to the Arduino - so you are pretty lucky as I can't! :smiley:
It because it has an 74LCX245 onboard, which is a Voltage Converter...

Ah, I thought I posted that earlier somewhere.
But I also paid $40 after shipping, and I got it within 3 days.

Stupid voltage converters.. :X
Do you know of any code I could take a glance at and figure out how to set up a menu? I tried looking through the Nuelectronics Nokia shields library, but yeah.. no good! :smiley:

I won't make your projects :stuck_out_tongue:
But I will help you getting started, and that's what I've done so far...
Now, try on your own - you have a complete library to use :o

Haha, no no! I thank you much! I'm trying to learn as much as I can, I'd rather you not make it :smiley:

I'm just a little confused on where to start with making a menu, haha but that's part of the game I suppose! :smiley:
Well wish me luck! :slight_smile:

Hey guys, I gave this a spin using one of the sparkfun Nokia LCD boards. It sorta works - I'm getting garbled blue and white junk on the lcd. I can make out the text - just.

I'm assuming these are still shipping with the Epson controller.

Who's tried the Sparkfun board - did you hook up the pin 2 to anything?

#define BL 2 // Digital 2 --> BL
#define CS 3 // Digital 3 --> #CS
#define CLK 4 // Digital 4 --> SCLK
#define SDA 5 // Digital 5 --> SDATA
#define RESET 6 // Digital 6 --> #RESET

Any ideas anyone? It's got me puzzled!