Hi- This question would be best put to a newsgroup concerning PicBasic. After perusing the web, I think you will have to split up W0 into the two parts. B0 and B1 are not what you want, as these (I think) are the two halves of W0 as bytes or B0=W0/256 and B1=W0 mod 256. You want the feed W0 out as its Whole-Part, a period, and its Fractional-Part, so define two more variables (the names will need to be appropriately chosen): B4 = W0/10 <-- the whole part of the result W1 = B4*10 B5 = W0-W1 <-- the fractional part of the result Now you need to send out #B4, a ".", and #B5 - you might need multiple SEROUTs for this bit. If B5 ends up being displayed as, say, "02" instead of "2" (ie with a leading zero) then you could try: B5=B5*10, so you would get "20" displayed instead, or if you can't live with the extra 0: B5="0"+B5 , which gets you the ASCII code for that digit into B5, and you would display with B5 (no #). Please note the above is based on this page: http://www.rentron.com/PicBasic-LCD.htm and some long ago hacking with Basic for PICs, so beware! David L. Barta wrote: > Hello, > > I'm pretty new to PIC programming and I'm having some problems. I'm > using PicBasic, CodeDesigner Lite, a Warp 13 > programmer, and a Serial LCD display in my project which works but not > like I'd like it to! > Here is my code: > > 'Ultrasonic Range Finder > > Symbol TRISB = 134 > Symbol PortB = 6 > Poke TRISB,8 > Loop: > SerOut 2, T2400, (12) 'Send out Clear Screen > Low 0 'Make sure Initiate is low > Pause 10 'Wait 10 MS > High 0 'Now Initiate Range Finder > PulsIn 3, 0, W3 'Receive "Echo", put data in W3 > Pause 150 'Wait .15 second > Low 0 'Bring initiate low > LET W2 = W3 * 10 'W3 times 10 equals W2 > IF W2 = 0 Then Loop 'If no data in W2, go to loop > LET W0 = W2 / 178 'Divide W2 by 178, put answer in W0 > Pause 10 'Wait a bit > SerOut 2, T2400, (12,2,#W0) 'Send what's in W0 out to > display******I've also tried this (12,1,2,#B0,46,#B1) > > Pause 800 'Wait .8 second > GoTo Loop 'Do it all again > End > > What I'd like this Ultrasonic Range Finder to do is to display in > large numbers, the feet and tenths of a foot on the LCD display. All > I've been able to get it to display is the feet and tenths of a foot > like this, 79, where the 7 is feet, and 9 is the tenths of a foot. I'd > like to have a decimal point between the feet and tenths of a foot on > the LCD display. The maximum range should be about 26'. > > I've tried manipulation of B0 and B1, but really don't understand > enough about this to have been, or to be successful. > > Any assistance any of you could be with this project, will be greatly > appreciated! > > Thanks. > L. Barta > > > > _______________________________________________ > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist