Pages: 1 2 [3] 4 5 ... 7   Go Down
Author Topic: Nokia 6100 LCD Display - Arduino Playground  (Read 22738 times)
0 Members and 1 Guest are viewing this topic.
Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

London, England
Offline Offline
Edison Member
*
Karma: 4
Posts: 1026
Go! Go! Arduinoooo !!!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Denmark (Europe)
Offline Offline
Full Member
***
Karma: 0
Posts: 198
Electronics Designer & Consultant
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: June 30, 2009, 04:27:01 am by tkj » Logged

Need any help with your electronics projects?
TKJ Electronics, a consultancy company located in Denmark (Europe), has the required ex

Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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! smiley-grin

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 :/
Logged

Denmark (Europe)
Offline Offline
Full Member
***
Karma: 0
Posts: 198
Electronics Designer & Consultant
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Need any help with your electronics projects?
TKJ Electronics, a consultancy company located in Denmark (Europe), has the required ex

Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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

Denmark (Europe)
Offline Offline
Full Member
***
Karma: 0
Posts: 198
Electronics Designer & Consultant
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

Need any help with your electronics projects?
TKJ Electronics, a consultancy company located in Denmark (Europe), has the required ex

Denmark (Europe)
Offline Offline
Full Member
***
Karma: 0
Posts: 198
Electronics Designer & Consultant
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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
Logged

Need any help with your electronics projects?
TKJ Electronics, a consultancy company located in Denmark (Europe), has the required ex

Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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-grin but for now, need to try!
Logged

Denmark (Europe)
Offline Offline
Full Member
***
Karma: 0
Posts: 198
Electronics Designer & Consultant
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You're right - I've missed that smiley-razz
So, is it working?

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

Need any help with your electronics projects?
TKJ Electronics, a consultancy company located in Denmark (Europe), has the required ex

Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Denmark (Europe)
Offline Offline
Full Member
***
Karma: 0
Posts: 198
Electronics Designer & Consultant
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
// 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!
Logged

Need any help with your electronics projects?
TKJ Electronics, a consultancy company located in Denmark (Europe), has the required ex

Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Awesome, works perfectly, thanks again! Well while I'm posting to such a skilled coder, haha smiley 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.. smiley-razz
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)

Logged

Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Spokane, Washington
Offline Offline
God Member
*****
Karma: 1
Posts: 686
My name is Bob, and I'm an addict.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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-grin
Logged

Pages: 1 2 [3] 4 5 ... 7   Go Up
Jump to: