division problem 500000 / 133


Results 1 to 6 of 6

Threaded View

  1. #5
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: division problem 500000 / 133

    Here is a snipit form a program I use and it works great:
    '************************************************* *******************
    CALCF_C: 'CALCULATE DEG.F and DEG.C for LM 95231 TEMPERATURE SENSOR READING
    '************************************************* *******************
    CALCF:
    SCRATCH = TEMPREAD * 1000
    TEMPF = DIV32 17777
    TEMPF = TEMPF * 10
    TEMPF = TEMPF + OFFSET
    CALCC:
    SCRATCH = TEMPREAD * 10
    TEMPC = DIV32 32
    RETURN

    Just make sure you don't have any interrupts going on when using DIV32.
    I also think your problem may be that you are using a variable after the DIV32 keyword. Try entering the constant value and see if that doesn't work.
    Last edited by Dave; - 24th May 2013 at 13:01.
    Dave Purola,
    N8NTA
    EN82fn

Similar Threads

  1. // Division Operator
    By Dick Ivers in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 9th September 2011, 15:27
  2. What is wrong with this division?
    By tjkelly in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 5th March 2010, 18:34
  3. Division by 0
    By sirvo in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 4th August 2007, 02:11
  4. Division with some decimal
    By Darklakebridge7 in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th May 2007, 07:41
  5. division
    By eoasap in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th March 2006, 17:26

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