Show Posts
|
|
Pages: [1]
|
|
3
|
Forum 2005-2010 (read only) / Interfacing / Re: LCD4Bit for 20x4 displays!
|
on: August 20, 2008, 01:36:03 pm
|
|
My quistion to you is, don't you have 2 enable pins on you LCD? in that case look at the repost in this trat Reply #7 from legba7
Else, tray to play with the x e.d. : x+= 0x80 ,0x14 0x54
I don't have your LCD so i can't try.
Good luck, and let us no if it works and with what values.
|
|
|
|
|
6
|
Forum 2005-2010 (read only) / Interfacing / Re: LCD4Bit for 20x4 displays!
|
on: August 19, 2008, 12:49:36 am
|
|
you forgot to show your error, but maybe this helps. I had errors to when compiling. The reason was that i had more liberies to control the lcd in the libary directory that use the same files. Try to tempery move other libs and try again.
I hope this hepls you.
|
|
|
|
|
7
|
Forum 2005-2010 (read only) / Interfacing / Re: LCD4Bit for 20x4 displays!
|
on: August 07, 2008, 02:12:54 pm
|
|
I changed the origenal 4bit library code my self to let it work with my 4x20LCD, KS0066u Based. I got it working perfectly. Below the code for those of you who have the same LCD.
LCD4Bit.cpp: changes i made just replace the origenal ones with this ones.
The new constructor:
LCD4Bit::LCD4Bit (int num_lines) { g_num_lines = num_lines; if (g_num_lines < 1) { g_num_lines = 1; } if (g_num_lines > 4) { g_num_lines = 4; } }
function cursorTo
void LCD4Bit::cursorTo(int line_num, int x){ //first, put cursor home commandWrite(CMD_HOME); if (x>19) { x=19; } switch (line_num) { case 1: x+=0x00 ; break; case 2: x+= 0x40 ; break; case 3: x+= 0x14 ; break; // In fact, line 3 is an extension of the line 1 (beyond the 20 first characters) case 4: x+= 0x54 ; break; // Line 4 is an extension of line 2 } // commandWrite(0x80+x); }
Test program:
#include <LCD4Bit.h> LCD4Bit lcd = LCD4Bit(4);
void setup() { pinMode(13, OUTPUT); //we'll use the debug LED to output a heartbeat lcd.init(); }
void loop() { digitalWrite(13, HIGH); //light the debug LED lcd.clear(); lcd.cursorTo(1,0); lcd.printIn("Line 1"); lcd.cursorTo(2,0); lcd.printIn("Line 2"); lcd.cursorTo(3,0); lcd.printIn("Line 3"); lcd.cursorTo(4,0); lcd.printIn("Line 4"); delay(1000); digitalWrite(13, LOW); //clear the debug LED }
Hope it works for you to!
|
|
|
|
|
9
|
Forum 2005-2010 (read only) / Interfacing / witch oscilloscope to buy
|
on: August 19, 2008, 07:26:12 am
|
|
I want to buy a scope and need to know how quick it must be. The Arduino runs on 16 MHz. 5MHz Pc Oscilloscope, 10MHz Pc Oscilloscope or 25MHz Pc Oscilloscope. (PicoScope) The prize dif is more then 150 euro's.
I wil use it to measure inputsignals from e.g. 433MHz reciever.
|
|
|
|
|