Sonic Depth Meter code & Math problems 12F683


Results 1 to 14 of 14

Threaded View

  1. #8
    Join Date
    Jan 2009
    Posts
    34


    Did you find this post helpful? Yes | No

    Default Re: Sonic Depth Meter code & Math problems 12F683

    Thanks guys. I'm trying to understand the math here, help me out.

    What is the difference between * and **? I can't seem to find something on this forum that explains this. How does the math work.

    For example, Henrik's suggestion above, how did you select 3060 to try and result in a range between 1 and 127? I tried random numbers and 2020 gets me close to my 127 value at full, but gives me 25 at empty. If I subtract 24 to give me 1, then I've also reduced my 127 to 103...Ugg.

    and while I'm at it...how doe the */ and // work?


    I really need the result to provide a linear value between 1 and 127 for this to work properly. So I feel like I need to determine the ratio of the reading (in this case with full reading 92 and emplty reading 364, I would subtract 91 from the values for an adjusted range between 1 and 273) then take the adjusted value and divide by 273 for a multiplier between 0 and 1 and apply that multiplier to 127.
    Last edited by johnnylynx; - 30th October 2013 at 05:01.

Similar Threads

  1. Replies: 0
    Last Post: - 27th March 2011, 20:10
  2. PIC 12f683 AD/PWM Problems:
    By surfer0815 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 7th December 2005, 16:48
  3. math problems (again)
    By lab310 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th November 2005, 22:43
  4. 12F683 Comparator Problems
    By morethanenuf in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 9th September 2005, 15:36
  5. math problems - large numbers
    By Tomasm in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 16th February 2004, 07:48

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