Shop OBEX P1 Docs P2 Docs Learn Events
iLoadMini Demo Unit change — Parallax Forums

iLoadMini Demo Unit change

moonpenmoonpen Posts: 3
edited 2015-06-25 06:22 in Propeller 1
Hi, I've been trying to convert the load data from the iLoadmini sensor using the demo [ http://obex.parallax.com/object/284 ] from imperial to metric.
This is for a school project and I am quite inexperienced with the propeller boards and the spin language but there is not much code to work from with other microprocessor boards.

Comments

  • kwinnkwinn Posts: 8,697
    edited 2015-06-25 06:22
    Multiply pounds by 0.4535924 to get kilograms, or 4.448222 to get newtons.

    BTW, there is a handy little free program called convert that will do all sorts of unit conversions.
  • Multiply pounds by 0.4535924 to get kilograms, or 4.448222 to get newtons.



    BTW, there is a handy little free program called convert that will do all sorts of unit conversions. I tried to multiply the load reading with 0.453...... and it shows up on the serial display as 0.0 or just freezes the code completely. Could I have done something wrong?
  • kwinnkwinn Posts: 8,697
    You probably used the spin multiply which only handles integers so 0.453 would end up as zero. You need to use the floating point multiply. Take a look at the PUB: GetLoad routine in the iLoadMini object. I think the floating point multiply should go just before the "dspLd :=" statement.

    Sorry, not in a position to test the code for this.
  • If you're just multiplying and dividing, you can use scaled integers.
    Instead of multiplying by 0.453, multiply by 453 but keep in mind the result is a thousand times the real value.
    When you display the results use a method like "DecPoint" to place a decimal point in the correct place. Here's a link to one example of doing this sort of thing.
  • You probably used the spin multiply which only handles integers so 0.453 would end up as zero. You need to use the floating point multiply. Take a look at the PUB: GetLoad routine in the iLoadMini object. I think the floating point multiply should go just before the "dspLd :=" statement.

    Sorry, not in a position to test the code for this.
    I think I have tried this and failed. I'm currently on holidays so i cant test it ether 
  • kwinnkwinn Posts: 8,697
    You probably used the spin multiply which only handles integers so 0.453 would end up as zero. You need to use the floating point multiply. Take a look at the PUB: GetLoad routine in the iLoadMini object. I think the floating point multiply should go just before the "dspLd :=" statement.

    Sorry, not in a position to test the code for this.
    I think I have tried this and failed. I'm currently on holidays so i cant test it ether 

    I'm working away from home as well. Will be back Friday night and look at it then.
Sign In or Register to comment.