Arctangent


Closed Thread
Results 1 to 3 of 3

Thread: Arctangent

Hybrid View

  1. #1
    Join Date
    Jun 2006
    Posts
    15

    Default Arctangent

    Hello,

    I've been poking around for the last two weeks trying to find out how to do an arctangent function with the PIC and finally gave up and joined the forum. I am using a PIC16F628 to read the Parallax HM55B compass module. Unfortunately all of the code I've found is for the Basic Stamp and it doesn't cross in certain places due to the ATN function which is not available to the PIC. I broke down today and ordered a Math Coprocessor from Parallax and a Basic Stamp BS2P-SX just so I can get the compass calibrated and working (functional) to interface to the other half of my project, but I ultimately want to use the PIC if I can.

    I did find some ASM code for arctangent but it's pretty confusing and I don't think everything is there to make the code work... I don't have the brain power to understand the ASM side of the PIC unfortunately.

    Has anyone worked on something like this before that has any tips or help to offer? I would greatly appreciate anything that would get me going to convert the X, -x, y and -y to brads and then to degrees without having the ATN function available to me.

    Can it even be done using PBP?

    Thanks for ANY help on this.
    Dave

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

  3. #3
    Join Date
    Jun 2006
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Awesome. That last link with the explanation from Melanie has got to be one of the best writeups I have even seen. I remember her from way back when I first started playing with PICs. It's been a while since I've broken out the box of PIC stuff but she still holds a place in my list of people to envy for her brain power.

    Thanks for the links. I had seen a few of them before, but I hadn't seen Melanie' explanation. I'll sit down and try to digest all of that information tonight... and if nothing else, use the co-processor for the project until I can understand what she was trying to say in all of those formulas. I see it on the screen but may as well be reading Japanese at the moment.

    Cheers,
    Dave

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts