I'm sorry but that's crazy. Why on earth are you showing tenths of a foot? Either use meters, in which case you can use tenths (as meters are base10)/ If you want to use feet, then I would think that you should show inches as the smaller unit (1/12). You can use the correct indicators also. ' indicates feet, " indicates inches. Sorry I can't help you with the code, I have never touched PicBasic. It looks pretty mixed up, maybe you should learn C or ASM instead, there would certainly be more help available if you did. 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