I looked a little more at the assembly code you attached to your post. One drawback, it uses LCD code that is written for 4 mhz crystal which makes it a bit less flexible. This could be edited out and more code written for pbp, to be flexible for use with different pics. By the time you do that, maybe Alain is right, better to use code that is written in picbasic.

I looked at the parallax code, like Alain suggested. They are using a lookup table with a pulsin command. This could be done pretty easily. If you want to make it more exciting, you could use an tan-1 or arctan function. Oh, but picbasic does not have an arctan function you might say.... True, but Darrel helped me get a atan2(y,x) function working, and atan2(y,1) is the same as the tan-1 or arctan function!

What am I talking about?
Well, I did a few searches on angle tilt and got to Freescale Semiconductors AN3461
http://www.freescale.com/files/senso...ote/AN3461.pdf

And they mention using the arctan function to determine the angle:

theta = tan-1 (Ax/Az) and I believe that angle of Y = tan-1(Ay/Az)

A lookup table for the 10 bit a/d converter would be a bit long. And we can have resolution of about .3 degrees with a 10 bit tilt sensor value. (I know your tilt sensor does not work on A/D converter, but rather pulse width, but you could still use this formula).

Here is the atan2 code:
http://www.picbasic.co.uk/forum/showthread.php?t=10528

I will try to show an example in the next couple days.