PDA

View Full Version : HSEROUT full 3 digit display of variable howto ?



RFsolution
- 23rd October 2008, 22:37
Hi PBPers

I have a HSEROUT problem

I have 2 AD converters where a want to sent the result to the serial port
Which is working fine

HSEROUT [DEC AD0," ",DEC AD1] or HSEROUT [#AD0," ",#AD1]

As the software which receives the value's always expect 7 characters
I'm having problems when the AD's value is less than 100, because
then it sends "52 128" instead of "052 128"
ofcourse the same with "0 0" instead of "000 000"

anyone an idea how to solve this ?

Thanks

skimask
- 23rd October 2008, 22:40
Read farther into the DEC modifiers in the book. You might find a little modifier of the modifier that'll give you those extra digits when the value doesn't give you enough digits.

RussMartin
- 23rd October 2008, 23:14
As the software which receives the value's always expect 7 characters
I'm having problems when the AD's value is less than 100, because
then it sends "52 128" instead of "052 128"
ofcourse the same with "0 0" instead of "000 000"

anyone an idea how to solve this ?

I think you can find the information you need for a solution 3 or 4 pages into SEROUT2. I had to highlight the forward reference under HSEROUT to remember it. (Sometimes the PBP manual isn't as "friendly" as it could be . . . )

RFsolution
- 24th October 2008, 13:53
DEC3 is the answer

Thanks to all !

Topic closed !