The problem is here, in bbb_dht_read.c // Record pulse widths for the expected result bits. for (int i=0; i < DHT_PULSES*2; i+=2) { // Count how long pin is low and store in pulseCounts[i] while (!bbb_mmio_input(pin)) { if (++pulseCounts[i] >= DHT_MAXCOUNT) { // Timeout waiting for response. set_default_priority(); printf("PulseCounts[i]: %d \n",pulseCounts[i]); return DHT_ERROR_TIMEOUT; } }
bbb_mmio_input(pin) returns 0 too much time and it returns DHT_ERROR_TIMEOUT. Il giorno domenica 12 febbraio 2017 16:59:02 UTC+1, Dennis Lee Bieber ha scritto: > > On Sun, 12 Feb 2017 02:54:10 -0800 (PST), Davide Aguiari > <gorg...@gmail.com <javascript:>> declaimed the following: > > >Yes I read about it, but I tried several times without success. > >I will try again tomorrow, but It's supposed to work 3 times of 4, not 1 > of > >10.. > > > > Note that the article originally came out in 2012, and was last > updated > 2015. Are you running Wheezy or Jessie? It's possible Jessie has changed > things enough to affect the timing -- especially if you are entering the > demo program command at the console each time (the process start-up may be > reproducing similar system timing, resulting in failure). > > Try modifying the demo program to loop internally -- maybe > counting how > many failures it gets before a successful read. > > Try running the demo at a higher priority level > > http://www.thegeekstuff.com/2013/08/nice-renice-command-examples/?utm_source=tuicool > > -- > Wulfraed Dennis Lee Bieber AF6VN > wlf...@ix.netcom.com <javascript:> HTTP://wlfraed.home.netcom.com/ > > -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/2f5bf8d1-b315-4ec7-9eb9-26cdd07cd0f3%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.