November 23, 2024, 04:15:21 AM

LCD16x2 print problem

Started by volfp1, March 08, 2014, 04:32:14 PM

Previous topic - Next topic

How to print value from variables

Extra code for each program to use with
0 (0%)
Library upgrade
1 (100%)

Total Members Voted: 1

volfp1

Dear all,
I am newbie on this forum and would like to say hello to everybody.

I would like to ask you if is some body who can help me with fixing trouble using LCD16x2 library for Shield-LCD16x2.
https://www.olimex.com/Products/Duino/Shields/SHIELD-LCD16x2/open-source-hardware
I tried all to print value on the display but I'm able to print text/string betwen "" only.

When I am using standard shield like from SparkFun or other with LiquidCristal library I am normaly write in code :lcd.print("Hello word")     >> display show test "Hello word"
code :lcd.print(value)            >> display show number which is store vairable "value".

When using Olimex Shield-LCD16x2 than I am not able to do the same.
code: lcd.lcdWrite("Hello word")  >> display will show Text "Hello word"
code: lcd.lcdWrite(value)         >> compiler break on error "invalid conversion from 'int' to 'char*'

Some body have idea to solve this?
I made function to decode values digits and then print (write) on requested cursor position, but it is extra code which is not needed when using standard paralel display control and reading of analog buttons value.

Thanks for help.

Beliar

Hi

I just bought the 16x2 from olimex in order to lern how to hande lcd stuff now i´m stuck with this Library from Olimex too and its laggs evrerything the display uses the same hitachi then other arduino shields but another pic (or is there a chance to get other firmware on the pic?)

16x2 Olimex these are the commands possible by the firmware

#define SET_TRIS    0x01
#define SET_LAT     0x02
#define GET_PORT    0x03
#define GET_BUT     0x05
#define GET_ID      0x20
#define GET_FRM     0x21
#define LCD_CLR     0x60
#define LCD_WR      0x61
#define SET_BL      0x62
#define UART_EN     0x10

#define BOARD_ID    0x65
#define ADDRESS     0x30

wich then ends in these "commands" made in the library from olimex
getID   KEYWORD2
getFirmwareVersion  KEYWORD2
uartEnable  KEYWORD2
pinMode KEYWORD2
digitalWrite    KEYWORD2
digitalRead KEYWORD2
readButtons KEYWORD2
lcdClear    KEYWORD2
lcdGoToXY   KEYWORD2
lcdWrite    KEYWORD2
lcdSetBlacklight KEYWORD2

wow 11 total different keywords that are different from everything else in the community >:(

This here is the Arduino lcdshield pic firmware wich will never run on this 16x2 :'(

#define LCD_CLEARDISPLAY        0x01
#define LCD_RETURNHOME          0x02
#define LCD_ENTRYMODESET        0x04
#define LCD_DISPLAYCONTROL      0x08
#define LCD_CURSORSHIFT         0x10
#define LCD_FUNCTIONSET         0x20
#define LCD_SETCGRAMADDR        0x40
#define LCD_SETDDRAMADDR        0x80

// flags for display entry mode
// ---------------------------------------------------------------------------
#define LCD_ENTRYRIGHT          0x00
#define LCD_ENTRYLEFT           0x02
#define LCD_ENTRYSHIFTINCREMENT 0x01
#define LCD_ENTRYSHIFTDECREMENT 0x00

// flags for display on/off and cursor control
// ---------------------------------------------------------------------------
#define LCD_DISPLAYON           0x04
#define LCD_DISPLAYOFF          0x00
#define LCD_CURSORON            0x02
#define LCD_CURSOROFF           0x00
#define LCD_BLINKON             0x01
#define LCD_BLINKOFF            0x00

// flags for display/cursor shift
// ---------------------------------------------------------------------------
#define LCD_DISPLAYMOVE         0x08
#define LCD_CURSORMOVE          0x00
#define LCD_MOVERIGHT           0x04
#define LCD_MOVELEFT            0x00

// flags for function set
// ---------------------------------------------------------------------------
#define LCD_8BITMODE            0x10
#define LCD_4BITMODE            0x00
#define LCD_2LINE               0x08
#define LCD_1LINE               0x00
#define LCD_5x10DOTS            0x04
#define LCD_5x8DOTS             0x00


// Define COMMAND and DATA LCD Rs (used by send method).
// ---------------------------------------------------------------------------
#define COMMAND                 0
#define DATA                    1
#define FOUR_BITS               2


/*!
@defined
@abstract   Defines the duration of the home and clear commands
@discussion This constant defines the time it takes for the home and clear
commands in the LCD - Time in microseconds.
*/
#define HOME_CLEAR_EXEC      2000

/*!
    @defined
    @abstract   Backlight off constant declaration
    @discussion Used in combination with the setBacklight to swith off the
LCD backlight. @set setBacklight
*/
#define BACKLIGHT_OFF           0

/*!
@defined
@abstract   Backlight on constant declaration
@discussion Used in combination with the setBacklight to swith on the
LCD backlight. @set setBacklight
*/
#define BACKLIGHT_ON          255


wich then ends in these "commands" by library ->>>>>>> :o

LiquidCrystal_SR        KEYWORD1
LiquidCrystal_I2C       KEYWORD1 :-*
LiquidCrystal_SR3W      KEYWORD1
LiquidCrystal           KEYWORD1
LCD                     KEYWORD1

###########################################
# Methods and Functions (KEYWORD2)
###########################################
begin                KEYWORD2
clear                KEYWORD2
home                 KEYWORD2
noDisplay            KEYWORD2
display              KEYWORD2
noBlink              KEYWORD2
blink                KEYWORD2 8)
noCursor             KEYWORD2
cursor               KEYWORD2
scrollDisplayLeft    KEYWORD2 8)
scrollDisplayRight   KEYWORD2
leftToRight          KEYWORD2
rightToLeft          KEYWORD2
moveCursorLeft       KEYWORD2
moveCursorRight      KEYWORD2
autoscroll           KEYWORD2
noAutoscroll         KEYWORD2
createChar           KEYWORD2
setCursor            KEYWORD2
print                KEYWORD2 :-*
write                KEYWORD2
println              KEYWORD2
backlight            KEYWORD2
noBacklight          KEYWORD2
on                   KEYWORD2
off                  KEYWORD2
setBacklightPin      KEYWORD2
setBacklight         KEYWORD2
###########################################
# Constants (LITERAL1)
###########################################
POSITIVE             LITERAL1
NEGATIVE             LITERAL1
BACKLIGHT_ON         LITERAL1
BACKLIGHT_OFF        LITERAL1


So i just paid 21eur for a display wich is mor or less useless for me since no one is comming up with a new firmware and library or get the firmware from the other pic thats in the orig.arduino shields on the olimex16x2 pic running !!! :'(

Please Olimex Team your Support is needed !!!

sry for the bad english and thx for reading....... :-X

gmi

Having the same issue here... I would really enjoy a simple solution for it, as I don't have time to write my own library right now.

If anybody has an answer, please post it.

Stanimir5F

Recently we updated the LCD16x2 library which added 2 overloaded lcdWrite functions to display integer and float numbers (thanks to Andrey Chevykalov for the update). So check it out: https://www.olimex.com/Products/Duino/Shields/SHIELD-LCD16x2/open-source-hardware

May the Source be with You!