XBee and XBee-PRO ZigBee RF modules provide cost-effective wireless connectivity to electronic devices. They are interoperable with other ZigBee PRO feature set devices, including devices from other vendors.
Type/IOSamples.h
- Committer:
- yangcq88517
- Date:
- 2015-10-30
- Revision:
- 4:a0f1fba6c2fb
- Parent:
- 2:700dc65ca3b1
- Child:
- 6:5f31ddc17239
File content as of revision 4:a0f1fba6c2fb:
#ifndef UK_AC_HERTS_SMARTLAB_XBEE_IOSamples #define UK_AC_HERTS_SMARTLAB_XBEE_IOSamples #include "Pin.h" #include <map> using namespace std; /** * A collection of digital and analog samples reported by XBee module. */ class IOSamples { private : int SUPPLY_VOLTAGE; map<Pin *, int> analog; map<Pin *, int> digital; public: /** * Get all the avaliable analog values. * * @returns map<Pin,int> */ map<Pin *, int> * getAnalogs(); /** * Get analog value from one pin. * * @param Pin XBee S1 or S2 pin object. * @returns -1 means sample not avaliable. */ int getAnalog(Pin * pin); /** * Get all the avaliable digital values. * * @returns map<Pin,int>: * LOW = 0, * HIGH = 1, * UNMONITORED = 2, */ map<Pin *, int> * getDigitals(); /** * Get digital value from one pin. * * @param Pin XBee S1 or S2 pin object. * @returns * LOW = 0, * HIGH = 1, * UNMONITORED = 2, */ int getDigital(Pin * pin); /** * Get supply voltage, S2 only. * * @returns voltage */ int getSupplyVoltage(); /** * Set supply voltage, S2 only. * * @param voltage */ void setSupplyVoltage(int voltage); /** * Cleat all the sample values. */ void clear(); }; #endif