Question about sensor data

Issue #42 resolved
Former user created an issue

Hello Everyone, i'm a noob in this, but i want to read de sensor value as "double" or change the "int" value to get a decimal number. I'm using Arduino Nano.

Ex. This is now : 0=10cm 1=12cm A need then this way: 0=10.23cm 1=10.23cm

Can anyone help me?

Thx

Comments (3)

  1. Tim Eckel repo owner

    First, see the Wiki for where you should go for support. This is for issues, not help. Secondly, what you want isn't technically possible, as the sensors isn't sensitive to the hundredth's of a cm. It's really only accurate down to the cm, which is why (by default) the ping_cm() returns integers. It's also done this way to save a LOT of memory (which is wasted as the sensors isn't that accurate).

    But, if you want to do this anyway (which is pointless) you should ask in the correct support forum.

  2. Tim Eckel repo owner

    Not an issue at all, just a question, should use the support link in the Wiki, not create an issue (and even worse make the issue "major").

  3. Log in to comment