Go Down

Topic: Nokia 6100 LCD Display - Arduino Playground (Read 56586 times) previous topic - next topic


Indeed, thanks alot Mike, makes alot more sense now.

I'm with Thomas on this one, confused why it won't work, but I have a few theories. I'm assuming because it's old code and just needs to be updated, but I'm optimistic.


It should compile fine. Has he installed those external libraries first?


Jun 30, 2009, 11:26 am Last Edit: Jun 30, 2009, 11:27 am by tkj Reason: 1
CaptainObvious - Yeah, I think soo too..
The Arduino IDE has changed alot the past, so that could be the problem why it can't be compiled!
But who is willing to recode the library for use with the newer Arduino IDE?


Thomas, you took the words right out of my mouth!
Haha, I've been trying to spend some extra time, creating and breaking down some libraries to try get a feel for em. But with as new as I am to code, it's just more confusing than anything.
And I'm wondering if it would be better to start with pre-exsisting library codes, or use the new sketch that actually works to start a new library. Regardless! I won't stop till I find an easier way to use my LCD! :D

And with the sketch I'm using right now, I have no idea what so ever how to use input values and print them on the screen :/


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


@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 ::)

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


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 (http://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...

Code: [Select]
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. :D but for now, need to try!


You're right - I've missed that :P
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)

Code: [Select]
// 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);
nokiaLcd.lcd_draw_text(YELLOW, BLACK, 35, 5, text);


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 :) 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.. :P
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.)

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)


I have a very-ghetto "Etch-a-Sketch" sketch at the moment! Complete with X and Y indicator!
Code: [Select]
 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

void loop()
char text [50];   // Not 100% sure if this is text size or what

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!

Go Up