Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
06/12/00 01:14
Read: times


 
#3157 - Success!!!!
Hi All,

With Steve Taylor's help, I was able to solve my problem! Here is the BASIC code I finally got to work for me. I have removed the line numbers so you can put it in your program however you want. This will be a subroutine I call after I get the voltage from the MAX154 and convert it to the actual voltage being measured.

CALL 2000H ; call routine to initialize the Optrex LCD 20x4 module

VOLT=12.345 ; value to be displayed

VOLT=VOLT/100 ; make it a decimal

FOR C=1 TO 5 ; length of decimal

N=INT(VOLT*10) ; get first digit in decimal

VOLT=(VOLT*10)-N ; get rid of the digit going to the LCD in VOLT

N=N+48 ; convert it to ascii

XBY(0FF81H)=N ; send the ascii code of the digit to LCD

IF C=2 THEN GOSUB 100 ; see if decimal should be written to LCD

NEXT C ; go and start converting next digit

RETURN ; return to take another measurement

XBY(0FF81H)=ASC(.) ; output a decimal point to LCD

RETURN ; continue converting remaining digits





List of 11 messages in thread
TopicAuthorDate
A/D to LCD using 80c31            01/01/70 00:00      
RE: A/D to LCD using 80c31            01/01/70 00:00      
RE: A/D to LCD using 80c31            01/01/70 00:00      
RE: A/D to LCD using 80c31            01/01/70 00:00      
RE: A/D to LCD using 80c31            01/01/70 00:00      
RE: A/D to LCD using 80c31            01/01/70 00:00      
RE: A/D to LCD using 80c31            01/01/70 00:00      
RE: A/D to LCD using 80c31            01/01/70 00:00      
RE: A/D to LCD using 80c31            01/01/70 00:00      
Success!!!!            01/01/70 00:00      
RE: A/D to LCD using 80c31            01/01/70 00:00      

Back to Subject List