Wiring Forum

All Forums => Website Questions => Topic started by: tc on July 24, 2012, 02:12:07 PM

Title: SHT15 error in the example code
Post by: tc on July 24, 2012, 02:12:07 PM
There is an error in the example code for SHT15 on page http://wiring.org.co/learning/basics/humiditytemperaturesht15.html (http://wiring.org.co/learning/basics/humiditytemperaturesht15.html)

In the code it says:
val = shiftIn(dataPin, clockPin, MSBFIRST, 8, 3);

The code works if it is changed to:
val = shiftIn(dataPin, clockPin, MSBFIRST);

/TC
Title: Re: SHT15 error in the example code
Post by: barragan on July 25, 2012, 11:03:03 AM
hi, it is not really an error, the example is using the shiftIn command with the count parameter set to 8 and 3 milliseconds delay, which is very near to the default, so it also works as you mention just invoking shiftIn(dataPin,clockPin,bitOrder)

shiftIn has different versions:

http://wiring.org.co/reference/shiftIn_.html (http://wiring.org.co/reference/shiftIn_.html)