Math Problems


Closed Thread
Results 1 to 2 of 2

Thread: Math Problems

  1. #1
    Join Date
    Sep 2005
    Location
    California USA
    Posts
    7

    Post Math Problems

    Hello Group,
    I have 2 floating Point problem that I can't figure out.
    The first is each time a switch closes I need to increment the value by .011 and have it display on a LCD with the correct value.
    The second problem is each time a switch closes I need to increment the value 1.492 and show it on a LDC.
    I have tried many things but I don't get the correct read outs.
    Can someone help me with the code to have the correct read outs.

    Than You
    William Oliver

  2. #2
    Join Date
    Sep 2009
    Posts
    737


    Did you find this post helpful? Yes | No

    Default Re: Math Problems

    Why you need to use FP for that
    You can use integers for that simple math...

    Code:
    Counter VAR LONG
    Main:
    IF button1=pressed THEN Counter = Counter + 11
    IF button2=pressed THEN Counter = Counter + 1492
    LCDOUT $FE,1, DEC Counter /1000, ".", DEC3 Counter //1000
    GOTO Main

Similar Threads

  1. Math problems with div32
    By srspinho in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 20th January 2015, 00:14
  2. Sonic Depth Meter code & Math problems 12F683
    By johnnylynx in forum PBP3
    Replies: 13
    Last Post: - 1st November 2013, 05:04
  3. PBPL Math...new math takes more cycles...Always?
    By skimask in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 10th February 2008, 10:22
  4. math problems (again)
    By lab310 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th November 2005, 22:43
  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 : 1

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