I am trying to print a number to a LCD. The number is in a byte of memory but I need to print a decimal point between digit 0 and digit 1. For example, if the number in memory is 155 it represents a voltage of 15.5 volts. My code includes the line:
B3 = B1 DIG 0
I get a syntax error on this line.
What is wrong with it?
I have also used B3 = B1 DIG 0 + "0" with the same results.
The manual states that The DIG command returns the decimal value of a 16 bit number. Therefore digit 0 of '67890' is 0 and digit 3 is '7'. To return an ascii value of the digit simply add ascii "0" to the digit value e.g.
let b1 = b2 DIG 0 + "0".
Since I want the decimal value of a number I assume that B1 = B2 DIG 0 is the correct syntax to use.
What I would like to use is somthing like this:
Serout 4, T2400, (#B1 DIG 2, #B1 DIG 1, ".", #B1 DIG 0)
Any ideas what I am doing wrong?
Dave
B3 = B1 DIG 0
I get a syntax error on this line.
What is wrong with it?
I have also used B3 = B1 DIG 0 + "0" with the same results.
The manual states that The DIG command returns the decimal value of a 16 bit number. Therefore digit 0 of '67890' is 0 and digit 3 is '7'. To return an ascii value of the digit simply add ascii "0" to the digit value e.g.
let b1 = b2 DIG 0 + "0".
Since I want the decimal value of a number I assume that B1 = B2 DIG 0 is the correct syntax to use.
What I would like to use is somthing like this:
Serout 4, T2400, (#B1 DIG 2, #B1 DIG 1, ".", #B1 DIG 0)
Any ideas what I am doing wrong?
Dave