LCD data

Christos

New Member
Hi Guys and Girls

I am a relative newbie to programming and picaxes and any assistance would be great
I am playing wth a picaxe and LCD and have read all the docs I can find. I found the one on Hippys web page fantastic.


WHat I am after is a little direction, Hippys code examples uses the constants Hello World

EEPROM 6,byte1
DisplayTopLine:
EEPROM 6, ("Hello")
FOR get = 6 TO 10
READ get,byte1
GOSUB SendDataByte
NEXT
MoveCursorToStartOfSecondLine:
byte1 = $C0
GOSUB SendCmdByte
DisplayBottomLine:
EEPROM 11,("World!")
FOR get = 11 TO 16
READ get,byte1
GOSUB SendDataByte
NEXT
END

What I would like to do is to use a variabe that I obtain from the readadc comand

so as I said earlier any assistance or direction would be fan - bloody- tastic

Cheers
Christos
 

westaust55

Moderator
Getting numbers out to LCD module

Examples as follows:

Code:
SYMBOL byte1 = whatever variable you have already used/declared
SYMBOL value = b7
SYMBOL hund = b8
SYMBOL tens = b9
SYMBOL units = b10

Readadc, pin, value ; gets  a result from 0 to 255
BINTOACSII value, hund, tens, units
Byte1 = hund
GOSUB SendDataByte
Byte1 = tens
GOSUB SendDataByte
Byte1 = units
GOSUB SendDataByte
untested , but if you are short on variables the following will/should also work

Code:
SYMBOL byte1 = whatever variable you have already used/declared
SYMBOL value = b7

Readadc, pin, value ; gets  a result from 0 to 255
Byte1 = value / 100 + $30
GOSUB SendDataByte
Byte1 = value // 100 / 10 +$30
GOSUB SendDataByte
Byte1 = value//10 +$30
GOSUB SendDataByte
 

tiscando

Senior Member
¿Are you using 'programming editor' from picaxe, and an axe033 serial lcd or something similar, or an lcd connected to a standard serial firmware chip?
If so, an example code is:

main:
pause 100
readadc 1,b1 'read the voltage of the ADC1 pin into b1
serout 0,n2400_4,(254,1) 'clear display (one of the special effects listed below)
serout 0,n2400_4,("ADC1= ",#b1) 'write onto lcd. If you get 'junk' charactors, then try changing the baudmode to t2400_4.
goto main

the # before b1 converts it's number into ascii charactors so if b1=150, the # converts it into "1","5","0" to type onto the lcd, so it won't type something like "û" instead.

And to type special charactors onto the lcd e.g. "è", see the 'advanced interfacing' section on manual 3 (interfacing circuits) at the 'lcd charactors' section. in the table, look for the character you want, and type the number into the serout command. the number is the column value + the row value, so if you're looking for "è", then it is on column 128 and row 10, so to type it onto the lcd then type 'serout 0,n2400_4,(138)' into the program.

and to move the lcd cursor and do the special effects, then type
SEROUT 0, N2400_4, (254, followed by:
1= Clear display and move to the start of the first line (used in code above)
2= Move the cursor and display ‘window’ to the start of the first line
4= Set ‘right to left printing’ mode
5= Set ‘scroll printing to the left’ mode
6= Set ‘left to right printing’ mode
7= Set ‘scroll printing to the right’ mode
10= Turn visual LCD screen off
12= Hide cursor
13= Make cursor flash
14= Turn visual LCD screen (and cursor) on
16= Move cursor left one position
20= Move cursor right one position
24= Scroll display ‘window’ left one position
28= Scroll display ‘window’ right one position
32-63=CG RAM inputs (see the axe033 lcd cgram wizard on the program editor)
64-127=CG RAM addresses (see the axe033 lcd cgram wizard on the programming editor)
128= Move cursor to the start of the first line
192= Move cursor to the start of the second line
move cursor to: 128-191($80-$bf)=top line, 192-255($c0-$ff)=bottom line.
)

...

or if your alphanumeric lcd display has pins 'd4' to 'd7', E or SE, and RS, and no serial pin (the axe033 might have all those pins and a serial pin, so just use the serial pin), see the picaxe manual 3 (interfacing circuits) at the advanced interfacing section to get information about the 'gosub senddatabyte.'
 
Last edited:
Top