The ADCs in the micaz produce 10 linear bits which are stuffed
into a u_int16, where (pretty much) 0x000 is 0 volts at the
sensor input and 0x3FF is the battery voltage (which is used
as the conversion reference). Note that, without external
level shift hardware, there is no concept of a negative value
therefore it's unsigned.
How you interpret the value afterwards depends on the sensor
and the application. For instance (most of) the Voltage sense
components scale the data such that the result is in milli-volts
-- basically turning it into a fixed-point value with 3 "decimal
digits" of mantissa.
There's not much point in using a FP value because it wastes
two bytes (I think floats are 4 bytes in our systems) to
represent a value that can only have 10 bits of resolution
to start with. And there's no on-board FP hardware so it
just complicates any math you may want to do.
MS
Roberto wrote:
Up to now, I have understood that a value read by a sensor must be
converted using a formula.
So, when I read data, I have a uint16 value.
This value must be converted with a formula (depending on the kind of data).
Is it correct???????
Thanks
2007/10/9, Roberto <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>:
hi all,
If I don't make a mistake, in sensing activitis micaz motes read
float values.
Because, in my work, micaz must send sensing data each to another,
how micaz handle float values?
How many bytes are occupied by a float value?
Where can i found documentation about my question?
Thanks in advance
--
Platform: Linux
TinyOS version: 2.x
Programmer: MIB510
Device(s): Micaz, Stargate
--
Platform: Linux Fedora
TinyOS version: 2.x
Programmer: MIB510
Device(s): Micaz, Stargate
------------------------------------------------------------------------
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help