Sensors
A sensor is a device that detects events or changes and provides a corresponding output, generally as an electrical signal.
There are two types of sensors: digital and analog. A motion sensor is a digital sensor because it can return two discrete values: movement detected or movement not detected. Other digital sensors might provide a binary value. A digital compass, for example, may provide your current heading by sending a 9-bit value with a range from 0 to 359. On the other hand, a thermometer is an analog sensor because the voltage output changes gradually as the temperature changes.
Setting pins for digital and analog sensors
Configure the pin of your XBee module according to the sensor that is connected to it:
- If you connect a digital sensor, configure the pin as Digital Input.
- If you connect an analog sensor, configure the pin as Analog to Digital Converter (ADC).
Note For more information about sensors, see the How XBee devices get sensor data section.