mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
grove.cxx: drop ADC resolution to 10bit for calculation
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
parent
d97ce2378b
commit
bbb7aa5a39
@ -79,8 +79,9 @@ GroveTemp::~GroveTemp()
|
|||||||
int GroveTemp::value ()
|
int GroveTemp::value ()
|
||||||
{
|
{
|
||||||
int a = mraa_aio_read(m_aio);
|
int a = mraa_aio_read(m_aio);
|
||||||
|
a = a >> 2;
|
||||||
float r = (float)(1023-a)*10000/a;
|
float r = (float)(1023-a)*10000/a;
|
||||||
float t = 1/(logf(r/10000)/3975 + 1/298.15)-273.15;
|
float t = 1/(log(r/10000)/3975 + 1/298.15)-273.15;
|
||||||
return (int) t;
|
return (int) t;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user