View on GitHub

SmallBasicPIGPIO

Plugin for SmallBASIC to access GPIO pins on a Raspberry PI

back to main page

DS18B20 Temperature Sensor

DS18B20_GetTemp

Temp = DS18B20_GetTemp(Pin)

Pin = 0 … 53
Temp = -999 … +999 or -1000 or -2000 or -3000

DS18B20Temp will return the temperature in °C measured by a DS18B20 1-wire temperature sensor. If the reading was not successful, the following error codes will be returned

-1000 -> Sensor could not be found (maybe not properly connected)
-2000 -> Data from sensor was fully recieved but data is corrupted
-3000 -> Could not read sensor data (sensor was found, but no data was received)

So far several DS18B20 cannot be chained at one pin. If you want to use more then one sensor, please connect each sensor to a new pin. From time to time the readout will result in an error. In this case perform the measurement again.

back to main page