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,... I know nothing about anyone of those, but just a few notes... > 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 is the data type of each variable ? 8-bit int ? 16-bit int ? Or maybe ome kind of "float" ? Does they have some default fdta type ? That is, you don't have to declare them ? /Jan-Erik. > _______________________________________________ http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist