Page 187

I have only just discovered (I have never used a DHT11!) that the DHT11  is not 100% compatible with the DHT22. The DHT11 uses a different encoding for the data. The DHT22 uses 16 binary for each of the values but the DHT22 uses a first decimal byte followed by a fractional byte. This means that for the DHT11 the decoding is just to take the first byte as the integer part and the second byte as the fractional part - and no need to divide by 10.

Also it has been pointed out the the 1ms start pulse is too low for some devices - increase it to 20ms if the device ignores you.

Page 290

The number of SPI buses a Raspberry Pi has depends on its model. The PiZero and Pi 3 have three SPI devices, but only SP0 and SP1 are available on the GPIO connector:

change SP0 and SP1 to SPI0 and SPI1 

The number of SPI buses a Raspberry Pi has depends on its model. The PiZero and Pi 3 have three SPI devices, but only SPI0 and SPI1 are available on the GPIO connector:

 

Page 298

First connect pin 19 to pin 20 using a jumper wire and start a new NetBeans project. The program is very simple. First we initialize the library and the SPI bus:

change 20 to 21

First connect pin 19 to pin 21 using a jumper wire and start a new NetBeans project. The program is very simple. First we initialize the library and the SPI bus: