imagelogin

Author Topic: SHT15 error in the example code  (Read 2167 times)

0 Members and 1 Guest are viewing this topic.

tc

SHT15 error in the example code
« 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

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

barragan

Re: SHT15 error in the example code
« Reply #1 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