Lcd displying numbers

Roseandthistle

New Member
Hi all.
I'm sort of new to the programming game. Boy what a learning curve.
I understand ladder logic better than basic. Anyway, I've got an idea to turn on 12 jfets, in order from 1 to 12. using a picaxe28X2 and out putting the jfet number to a 20x4 serial lcd.
Using the simulator, I've got the lcd screen to display what I want it to, and
the 28X2 outputs fire in order, but, I'm having problems getting the numbers to display correctly. At the moment the numbers start with 1 and continue to fill the screen with numbers 1 through 12.
Thank you
 

Attachments

westaust55

Moderator
Welcome to the PICAXE forum.

Noting that you are using a baudrate of 9600, suggests you are using other than the Rev Ed AXE033.

Can you provide a link to the LCD display(s) you are using.

I presume that the values 1, 2, 3, 4 are being displayed each further to the right across the display and maybe eventually wrapping onto another line.

For now, guessing as to the control commands being as per most LCD displays:

with respect to your code, where you have lines such as:
HIGH C.5 serout A.0,N9600,(144," 2")​

it is likely that you need to indicate that the 144 is part of a control command to position the " 2" which is what you want displayed.

try changing them to
HIGH C.5 serout A.0,N9600,(254, 144," 2")​


EDIT:
the 254 is a control code that indicates the following value (eg 144) is an action to be performed.
 
Last edited:

eclectic

Moderator
This is working on a 4 line LCD, at n2400
Code:
#PICAXE 28X2
'#COM COM4
#SLOT NUMBER 0
'#FREQ M8


'OUTPUTS:

 'C4	RELAY1
 'C5	RELAY2
 'C6	RELAY3
 'C7	RELAY4
 'B0	RELAY5
 'B1	RELAY6
 'B2	RELAY7
 'B3	RELAY8
 'B4	RELAY9
 'B5	RELAY10
 'B6	RELAY11
 'B7	RELAY12

 'C1	6VDC MODE
 'C2	12VDC MODE
 'C3	START CHARGE

'INPUTS:

 'C0	STOP CHARGE
 'A0	LCD
 'A1	OP AMP ADC

'SET PINS:

let dirsB = %11111111 'SET PINS AS OUTPUTS
let pinsB = %00000000 'SET AS OFF
let dirsC = %11110000 'SET PINS AS OUTPUTS
let pinsC = %00000001 'SET AS OFF, C0 INPUT
let adcsetup = 0

'SET CONSTANTS/VARIABLES

SYMBOL TIMEOFF=1000
SYMBOL BATTNUM= B0

'LCD:

INIT:
serout A.0,N2400,(254,1) ; ********* Clear and wait

pause 1000

Mainlcd:


serout A.0,N2400,(254,128,"SEQUENTIAL    ")
serout A.0,N2400,(254,148,"BATTERY CHARGER  ")
serout A.0,N2400,(254,188,"MODEL 1200   ")


pause 6000
serout A.0,N2400,(254,1)

serout A.0,N2400,(254,128,"Battery Number")

serout A.0,N2400,(254,192,"Is now charging at")
serout A.0,N2400,(254,158,"AMPS")






MAIN:
      HIGH C.4 serout A.0,N2400,(254,145," 1")
	PAUSE TIMEOFF
	LOW C.4
	HIGH C.5 serout A.0,N2400,(254,145," 2")
	PAUSE TIMEOFF
	; serout A.0,N2400,(254,145," ")  *************removed *
	LOW C.5
	HIGH C.6 serout A.0,N2400,(254,145," 3") 
	PAUSE TIMEOFF
	LOW C.6
	HIGH C.7 serout A.0,N2400,(254,145," 4")
	PAUSE TIMEOFF
	LOW C.7
      HIGH B.0 serout A.0,N2400,(254,145," 5")
	PAUSE TIMEOFF
	LOW B.0
	HIGH B.1 serout A.0,N2400,(254,145," 6")
	PAUSE TIMEOFF
	LOW B.1
	HIGH B.2 serout A.0,N2400,(254,145," 7")
	PAUSE TIMEOFF
	LOW B.2
	HIGH B.3 serout A.0,N2400,(254,145," 8")
	PAUSE TIMEOFF
	LOW B.3
	HIGH B.4 serout A.0,N2400,(254,145," 9")
	PAUSE TIMEOFF
	LOW B.4
	HIGH B.5 serout A.0,N2400,(254,145,"10")
	PAUSE TIMEOFF
	LOW B.5
	HIGH B.6 serout A.0,N2400,(254,145,"11")
	PAUSE TIMEOFF
	LOW B.6
	HIGH B.7 serout A.0,N2400,(254,145,"12")
	PAUSE TIMEOFF
	LOW B.7

 GOTO MAIN
e
 
Top