[fpc-pascal] Reading AM2302 temp/humid sensor on RaspberryPi?

Mark Morgan Lloyd markMLl.fpc-pascal at telemetry.co.uk
Thu Aug 23 13:28:16 CEST 2018


On 23/08/18 10:00, Martin Schreiber wrote:
> On Thursday 23 August 2018 11:11:34 Bo Berglund wrote:> On Thu, 23 Aug 2018 09:00:07 +0200, Bo Berglund>> <bo.berglund at gmail.com> wrote:> >I will need a higher resolution GetTickCount for this...>> Is there in fact a way (on Linux - Raspbian) to get a tickcount with> higher resolution than 1 ms?

On a mid-00s server I'm using clock_gettime(CLOCK_REALTIME which is 
apparently better than 1uSec, but from previously looking at older PCs 
and (I think) RPi3 your mileage may vary enormously. AIUI there's been a 
lot of issues over the years with different cores not having their 
counters in step, with counter frequency following dynamic clocks rather 
than being fixed and so on.

The AM2302 datasheet suggests that it's a device to be avoided assiduously.

-- 
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]



More information about the fpc-pascal mailing list