Converting the digital reading from ADC to a whole number
Hello,
I have just done the example in the basic analog and digital book regarding the ADC, it finds the analog input from the digital output by taking the remainders method and outputs to the degub screen by using the following code:
Display:
· DEBUG HOME
· DEBUG "8-bit binary value:· ", BIN8 adcbits
· DEBUG CR, CR, "Decimal value: ",DEC3 adcbits
·· DEBUG CR, CR, "volts: ",DEC1 v , "." , DEC2 v2
· RETURN
...
Instead of saying display v then display v2, is there a way to concatenate v and v2 to make it one variable instead of two?
Any help would be greatly appreciated.
Cheers
·
I have just done the example in the basic analog and digital book regarding the ADC, it finds the analog input from the digital output by taking the remainders method and outputs to the degub screen by using the following code:
Display:
· DEBUG HOME
· DEBUG "8-bit binary value:· ", BIN8 adcbits
· DEBUG CR, CR, "Decimal value: ",DEC3 adcbits
·· DEBUG CR, CR, "volts: ",DEC1 v , "." , DEC2 v2
· RETURN
...
Instead of saying display v then display v2, is there a way to concatenate v and v2 to make it one variable instead of two?
Any help would be greatly appreciated.
Cheers
·
Comments
This does what you're saying, but may not really be what you want.
Note that v should be declared as a word for this to work for voltages
greater than 2.55