not quite understanding the MATH function


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Rhatidbwoy's Avatar
    Rhatidbwoy Guest


    Did you find this post helpful? Yes | No

    Default

    I got the last thing that you have said with the word and byte. Was reviewing that. The other thing is that I will have to change the value of 1-2 to something with higher values.


    All to what I am trying to do is create a means to control a servo. The time constant that I was trying to work with first is that of 1-2 sec. That will have to change in means to 1-11 I guess. the only reason to that guess is the tenth place there are so many given posibility that will end up between 1-2 with .1 increment. So I guess then I would have to make the appropriate changes to the equation.

    In other words I was using 0 to 255 as my input(y-axis) and 1-2 as my result(x-axis) coming to the equation of what I have there for my normal eq. and my reverse eq. I would just have to figure things out for my x-axis as being 1-11 rather than 1-2 . This whole thing does make sense. This then leave me to further refining the program to get that of the 1-2sec with IF..THEN and PULOUT. Not to bad.


    The other thing to is that I did some reviewing and found out to what you are talking about with the shifts. I do have to THANK YOU. on the side note you taught me a few thing along with this forum. Yes there are people that are willing to help, but I believe the power of understanding is learning it. I can say that I did learn something and it is not just this problem but to what this forum has to offer.

  2. #2
    Join Date
    Nov 2005
    Location
    Perth, Australia
    Posts
    429


    Did you find this post helpful? Yes | No

    Default

    Rhatidbwoy: No problem at all. I'm glad to help.

    What you could do is apply a scaler to your result. For example, instead of seconds, work it out in milliseconds (scaler of 1000). Or if you dont need it that accurate, use a smaller scaler like 32 for example. Its good to choose a scaler that is a power of 2 (i.e. 2, 4, 8, 16, etc...) becuase you can multiply by these numbers very quickly and easily using the shifting you have learned.

Similar Threads

  1. Resolution integer math assistance?
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th January 2010, 04:01
  2. Line Graph, math problem...
    By TerdRatchett in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th May 2009, 05:20
  3. PBPL Math...new math takes more cycles...Always?
    By skimask in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th February 2008, 11:22
  4. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 10:45
  5. Random function - How to limit it ??
    By martarse in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 30th November 2004, 15:05

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