Multiplication on a PIC??


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125

    Question Multiplication on a PIC??

    I am still not sure how the math functions work on the PIC level -- so much different than in say 'MS Excel'....

    I have a value (address) which is ranging from 0 to 64,000.

    I want to compute and display the %age of memory full. Pretty simple.

    (Address/64000)*100 = my_value

    If Address = 30,000, then my_value = 46.88 ..

    However, in my PicBasicPro world, the formula

    (Address/64000)*100 nets me '0'....

    I want to be able to display on an LCD -

    Memory: %46.8

    Figure using the my_value dig 2, my_value dig 1,".",my_value

    might do it, but alas.. nothing..

    What's the trick? (Yes, I've read the manual.. I am not strong in math and it does not make much sense to me)

    Help!

    Tom

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello Tom...


    Tom>>However, in my PicBasicPro world, the formula

    (Address/64000)*100 nets me '0'....<<

    Divide by 64 then move your decimal over
    lets say you have

    30,000

    30000/64 = 468

    Which represents 46.8

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  3. #3
    Join Date
    Feb 2005
    Location
    Bellevue
    Posts
    125


    Did you find this post helpful? Yes | No

    Smile

    Ahh!! Easy, huh! Thanks. Works great

  4. #4
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    You're welcome anytime!

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. Replies: 67
    Last Post: - 8th December 2009, 02:27
  3. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  4. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

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