Hello everyone.
My name is Sheldon and I am new to this group.
I have some 8052 Basic programing questions that I hope someone
can help me with.
I've constructed an 8052-Basic s.b.c. using circuits from Jan Axelson's
Micro Ideabook. I've added 2 8255s for I.O. One 8255 is dedicated to an
lcd display.
The board and display work.
I'd like to send variables to the lcd and am wondering if it can be done in
8052-Basic .
I can send strings to the lcd ok. Such as,
10 STRING 100,20
20 $(1)="TEMPERATURE IS"
30 FOR X =1 TO 14
40 D=ASC($(1),X) :GOSUB 100
50 NEXT X
90 END
100 XBY(X)=RS+1 Rem Bring register select lcd pin high
110 XBY(X)=RW Rem Bring r/w select pin low to write
120 XBY(A)=D Rem Write data to lcd
130 XBY(X)=E+1 :XBY(X)=3DE Rem Toggle lcd e pin.
140 Return
The subroutine is from the book too. Thanks Jan !
This works . However, if I want to send a variable such as,
10 2+2=N
I put it in the asc grinder as,
20 D=ASC(N) :GOSUB 100
Doesn't work. It sends N to the lcd.
I want to send the variable 4 to the lcd
However,
10 PRINT N Prints 4 to the monitor. And,
20 PRINT ASC(N) Prints 70 to the monitor (asci of 4)
I've also tried putting the variable in a string like
10 $(2)=N
20 D=ASC(N) :GOSUB 100
Doesn't work.
Basic gives error for line 10.
Any ideas ?