Reading basic sensors

There are some basic sensors that can be plugged directly to Waspmote except for the light sensor which needs some hardware modifications.

DS18B20 Temperature Sensor

This temperature sensor also needs a simple hardware modification to be directly plugged to Waspmote. Three pins come out of the sensor: Red (3V3), Black (GND) and White (Output pin). A 4K7 resistor must be connected between the red and white pins. The sensor output can be plugged in any Waspmote digital pin. When reading the sensor the output pin is selected as input parameter:
Example of use:
// temperature sensor plugged to DIGITAL8 pin
float temp;
temp = Utils.readTempDS1820(DIGITAL8);
Reading DS18B20 temperature sensor example: