Let's Make Robots!

Two Arduino problems fixed in one day! Halelujah!

 I've been procrastinating on two problems that I've not been able to resolve  - or google an answer for in my code.


1) Slow response in the Serial.parseInt() function... yes google gave me lots of people with the same problem, but I finally found a reference to  Serial.setTimeout()  ... well what do you know...  I set Serial.setTimeout(50)  in my setup... and low and behold...

  SNAP RESPONSE now!!!!   


2)  And worse... I have integrated an RHT03 one wire Temperature and Humidity sensor... roughly equivalent to the DHT22.  From day one, I've used a derivative of the nethoncho library (https://github.com/nethoncho/Arduino-DHT22)  from


as it seemed to be the one most articles referenced...  Alas I've been plagued with CRC errors and sporadic temperature/humidity errors where I wrote contraints to ignore anything outside of "normal".

Today I was reading    http://apartmentarduino.blogspot.com/2012/01/step-three-interfacing-rht03.html

and   http://garagelab.com/profiles/blogs/tutorial-humidity-and-temperature-sensor-with-arduino

which point back to   http://playground.arduino.cc/Main/DHTLib ..... 


Now I had tried this one earlier... or so I had thought... but...

Desperate times call for desperate measures....  I remove all of my DHT22 code... replace it with the DHT library....


(horns and drums please!)


I'm now getting consistent readings !!!!  


Two down,  only about a hundred more to go....



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I use timeout values with pulseIn()because otherwise the default value is 1 second.

When reading signals from an RC receiver, since the pulse is meant to repeat every 2mS. I set the timeout for 22000uS allowing 10% extra just in case.

With reading the excho from an ultrasonic range finder I limit the timeout to match the longest distance I am interested in (within 3m usually).

See... it's little tidbits like that, that you would never think of, working in a bubble.


ok... maybe YOU would... LOL..


Thanks OB.

Thanks for sharing the information you have gleaned.

I've learned so much in the few months that I've trolled/signed up at this site... Might as well show others the spots where I've stubbed my toes, so they don't have to.

I am nothing if not truly appreciative.