Shop OBEX P1 Docs P2 Docs Learn Events
Taking A value from a DS1302 and Multiply 1.7 Posted the Routine to get this t — Parallax Forums

Taking A value from a DS1302 and Multiply 1.7 Posted the Routine to get this t

sam_sam_samsam_sam_sam Posts: 2,286
edited 2009-05-01 02:24 in General Discussion
Hi EveryOne

This is a project that I have been ·ask to do·by employer

As of right now I can not give all of the details.......................
................·but when the Project is done I will share with all of you on the Forum


We have a process that we do that we need to keep track of how much product·is left in the ·silo
so we can call th vendor to order more product there is NO WAY to put a scale to weight the silo

The only way is to do this is time how much ·product is used in one minute and keep track of it that way

Now I know how to Start and Stop The DS1302 Time Chip

And I can get the amount of product that is used in one minute

What I need to know is how to take the TIME VALUE and the AMOUNT OF PRODUCT in ONE MINUTE
and keep track of how much product is left in the SILO

I am not very good doing the P Basic Math

So is there any one out there that can help me with this problem

Let Just use 1.7 pound that are being·used in one minute

How would you write the code to do this
·

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any·idea.gif·that you may have and all of your time finding them

·
·
·
·
Sam

Post Edited (sam_sam_sam) : 5/4/2009 4:14:15 AM GMT

Comments

  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-04-30 23:24
    sam_sam_sam,

    To multiply by 1.7 ...

    Take 1.7 and multiply that by 256 on a calculator and you get 435.2
    Since the BS2 can only do integer math, 435.2 becomes 435. So instead of 1.7 you are actually multiplying by 1.6992· (<-- 435/256 = 1.6992.. )

    NewNum = OldNum */ 435

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2009-04-30 23:31
    ·Beau Schweable

    Thank You for making this very easy to understand···· ·smile.gif

    This will Help alot

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam
  • sam_sam_samsam_sam_sam Posts: 2,286
    edited 2009-05-01 02:24
    ·Here is the Demo Code that I am Using

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ··Thanks for any·idea.gif·that you may have and all of your time finding them

    ·
    ·
    ·
    ·
    Sam

    Post Edited (sam_sam_sam) : 5/1/2009 1:37:32 PM GMT
Sign In or Register to comment.