Adafruit Library
WipperSnapper_I2C_Driver.h
Go to the documentation of this file.
1 
16 #ifndef WipperSnapper_I2C_Driver_H
17 #define WipperSnapper_I2C_Driver_H
18 
19 #include "wippersnapper/i2c/v1/i2c.pb.h"
20 #include <Adafruit_Sensor.h>
21 #include <Arduino.h>
22 #include <Wire.h>
23 
24 #define PERIOD_24HRS_AGO_MILLIS (millis() - (24 * 60 * 60 * 1000))
25 
27 /**************************************************************************/
31 /**************************************************************************/
33 
34 public:
35  /*******************************************************************************/
43  /*******************************************************************************/
44  WipperSnapper_I2C_Driver(TwoWire *i2c, uint16_t sensorAddress) {
45  _i2c = i2c;
46  _sensorAddress = sensorAddress;
47  }
48 
49  /*******************************************************************************/
53  /*******************************************************************************/
55 
56  /*******************************************************************************/
68  /*******************************************************************************/
69  virtual void fastTick() {}
70 
71  /*******************************************************************************/
76  /*******************************************************************************/
77  bool begin() { return false; }
78 
79  /*******************************************************************************/
87  /*******************************************************************************/
88  void setSensorPeriod(float period,
89  wippersnapper_i2c_v1_SensorType sensorType) {
90  long sensorPeriod = (long)period * 1000;
91 
92  switch (sensorType) {
93  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE:
94  _tempSensorPeriod = sensorPeriod;
95  break;
96  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RELATIVE_HUMIDITY:
97  _humidSensorPeriod = sensorPeriod;
98  break;
99  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PRESSURE:
100  _pressureSensorPeriod = sensorPeriod;
101  break;
102  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CO2:
103  _CO2SensorPeriod = sensorPeriod;
104  break;
105  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ECO2:
106  _ECO2SensorPeriod = sensorPeriod;
107  break;
108  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_TVOC:
109  _TVOCSensorPeriod = sensorPeriod;
110  break;
111  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_ALTITUDE:
112  _altitudeSensorPeriod = sensorPeriod;
113  break;
114  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE:
115  _objectTempSensorPeriod = sensorPeriod;
116  break;
117  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_LIGHT:
118  _lightSensorPeriod = sensorPeriod;
119  break;
120  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM10_STD:
121  _PM10SensorPeriod = sensorPeriod;
122  break;
123  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM25_STD:
124  _PM25SensorPeriod = sensorPeriod;
125  break;
126  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PM100_STD:
127  _PM100SensorPeriod = sensorPeriod;
128  break;
129  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_UNITLESS_PERCENT:
130  _unitlessPercentPeriod = sensorPeriod;
131  break;
132  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOLTAGE:
133  _voltagePeriod = sensorPeriod;
134  break;
135  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_CURRENT:
136  _currentPeriod = sensorPeriod;
137  break;
138  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_PROXIMITY:
139  _proximitySensorPeriod = sensorPeriod;
140  break;
141  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_RAW:
142  _rawSensorPeriod = sensorPeriod;
143  break;
144  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_AMBIENT_TEMPERATURE_FAHRENHEIT:
145  _ambientTempFPeriod = sensorPeriod;
146  break;
147  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_OBJECT_TEMPERATURE_FAHRENHEIT:
148  _objectTempFPeriod = sensorPeriod;
149  break;
150  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_GAS_RESISTANCE:
151  _gasResistancePeriod = sensorPeriod;
152  break;
153  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_NOX_INDEX:
154  _NOxIndexPeriod = sensorPeriod;
155  break;
156  case wippersnapper_i2c_v1_SensorType_SENSOR_TYPE_VOC_INDEX:
157  _VOCIndexPeriod = sensorPeriod;
158  break;
159  default:
160  break;
161  }
162  }
163 
164  /*******************************************************************************/
171  /*******************************************************************************/
172  void
173  configureDriver(wippersnapper_i2c_v1_I2CDeviceInitRequest *msgDeviceInitReq) {
174  int propertyIdx = 0; // contains the amount of i2c sensors in the
175  // msgDeviceInitReq to configure
176  while (propertyIdx < msgDeviceInitReq->i2c_device_properties_count) {
178  msgDeviceInitReq->i2c_device_properties[propertyIdx].sensor_period,
179  msgDeviceInitReq->i2c_device_properties[propertyIdx].sensor_type);
180  ++propertyIdx;
181  }
182  }
183 
184  /*******************************************************************************/
189  /*******************************************************************************/
190  uint16_t getI2CAddress() { return _sensorAddress; }
191 
192  /****************************** SENSOR_TYPE: CO2
193  * *******************************/
194  /*********************************************************************************/
200  /*********************************************************************************/
201  virtual long getSensorCO2Period() { return _CO2SensorPeriod; }
202 
203  /*********************************************************************************/
209  /*********************************************************************************/
210  virtual long getSensorCO2PeriodPrv() { return _CO2SensorPeriodPrv; }
211 
212  /*******************************************************************************/
218  /*******************************************************************************/
219  virtual void setSensorCO2PeriodPrv(long period) {
220  _CO2SensorPeriodPrv = period;
221  }
222 
223  /*******************************************************************************/
231  /*******************************************************************************/
232  virtual bool getEventCO2(sensors_event_t *co2Event) {
233  (void)
234  co2Event; // Parameter is intentionally unused in this virtual function.
235  return false;
236  }
237 
238  /****************************** SENSOR_TYPE: ECO2
239  * *******************************/
240  /*********************************************************************************/
246  /*********************************************************************************/
247  virtual long getSensorECO2Period() { return _ECO2SensorPeriod; }
248 
249  /*********************************************************************************/
255  /*********************************************************************************/
256  virtual long getSensorECO2PeriodPrv() { return _ECO2SensorPeriodPrv; }
257 
258  /*******************************************************************************/
264  /*******************************************************************************/
265  virtual void setSensorECO2PeriodPrv(long period) {
266  _ECO2SensorPeriodPrv = period;
267  }
268 
269  /*******************************************************************************/
277  /*******************************************************************************/
278  virtual bool getEventECO2(sensors_event_t *eco2Event) {
279  (void)eco2Event; // Parameter is intentionally unused in this virtual
280  // function.
281  return false;
282  }
283 
284  /****************************** SENSOR_TYPE: TVOC
285  * *******************************/
286  /*********************************************************************************/
292  /*********************************************************************************/
293  virtual long getSensorTVOCPeriod() { return _TVOCSensorPeriod; }
294 
295  /*********************************************************************************/
301  /*********************************************************************************/
302  virtual long getSensorTVOCPeriodPrv() { return _TVOCSensorPeriodPrv; }
303 
304  /*******************************************************************************/
310  /*******************************************************************************/
311  virtual void setSensorTVOCPeriodPrv(long period) {
312  _TVOCSensorPeriodPrv = period;
313  }
314 
315  /*******************************************************************************/
323  /*******************************************************************************/
324  virtual bool getEventTVOC(sensors_event_t *tvocEvent) {
325  (void)tvocEvent; // Parameter is intentionally unused in this virtual
326  // function.
327  return false;
328  }
329 
330  /********************** SENSOR_TYPE: AMBIENT TEMPERATURE (°C)
331  * ***********************/
332  /*********************************************************************************/
338  /*********************************************************************************/
340 
341  /*********************************************************************************/
348  /*********************************************************************************/
350 
351  /*******************************************************************************/
359  /*******************************************************************************/
360  virtual void setSensorAmbientTempPeriodPrv(long periodPrv) {
361  _tempSensorPeriodPrv = periodPrv;
362  }
363 
364  /*******************************************************************************/
373  /*******************************************************************************/
374  virtual bool getEventAmbientTemp(sensors_event_t *tempEvent) {
375  (void)tempEvent; // Parameter is intentionally unused in this virtual
376  // function.
377  return false;
378  }
379 
380  /************************* SENSOR_TYPE: RELATIVE_HUMIDITY
381  * ***********************/
382  /*********************************************************************************/
388  /*********************************************************************************/
390 
391  /*********************************************************************************/
397  /*********************************************************************************/
399  return _humidSensorPeriodPrv;
400  }
401 
402  /*******************************************************************************/
408  /*******************************************************************************/
409  virtual void setSensorRelativeHumidityPeriodPrv(long periodPrv) {
410  _humidSensorPeriodPrv = periodPrv;
411  }
412 
413  /*******************************************************************************/
422  /*******************************************************************************/
423  virtual bool getEventRelativeHumidity(sensors_event_t *humidEvent) {
424  (void)humidEvent; // Parameter is intentionally unused in this virtual
425  // function.
426  return false;
427  }
428 
429  /**************************** SENSOR_TYPE: PRESSURE
430  * ****************************/
431  /*********************************************************************************/
437  /*********************************************************************************/
439 
440  /*********************************************************************************/
446  /*********************************************************************************/
448 
449  /*******************************************************************************/
455  /*******************************************************************************/
456  virtual void setSensorPressurePeriodPrv(long period) {
457  _pressureSensorPeriodPrv = period;
458  }
459 
460  /*******************************************************************************/
469  /*******************************************************************************/
470  virtual bool getEventPressure(sensors_event_t *pressureEvent) {
471  (void)pressureEvent; // Parameter is intentionally unused in this virtual
472  // function.
473  return false;
474  }
475 
476  /**************************** SENSOR_TYPE: Altitude
477  * ****************************/
478  /*********************************************************************************/
484  /*********************************************************************************/
486 
487  /*********************************************************************************/
493  /*********************************************************************************/
495 
496  /*******************************************************************************/
502  /*******************************************************************************/
503  virtual void setSensorAltitudePeriodPrv(long period) {
504  _altitudeSensorPeriodPrv = period;
505  }
506 
507  /*******************************************************************************/
516  /*******************************************************************************/
517  virtual bool getEventAltitude(sensors_event_t *altitudeEvent) {
518  (void)altitudeEvent; // Parameter is intentionally unused in this virtual
519  // function.
520  return false;
521  }
522 
523  /**************************** SENSOR_TYPE: Object_Temperature
524  * ****************************/
525  /*********************************************************************************/
532  /*********************************************************************************/
534 
535  /*********************************************************************************/
542  /*********************************************************************************/
545  }
546 
547  /*******************************************************************************/
554  /*******************************************************************************/
555  virtual void setSensorObjectTempPeriodPrv(long period) {
557  }
558 
559  /*******************************************************************************/
568  /*******************************************************************************/
569  virtual bool getEventObjectTemp(sensors_event_t *objectTempEvent) {
570  (void)objectTempEvent; // Parameter is intentionally unused in this virtual
571  // function.
572  return false;
573  }
574 
575  /**************************** SENSOR_TYPE: LIGHT
576  * ****************************/
577  /*********************************************************************************/
584  /*********************************************************************************/
585  virtual long getSensorLightPeriod() { return _lightSensorPeriod; }
586 
587  /*********************************************************************************/
594  /*********************************************************************************/
596 
597  /*******************************************************************************/
604  /*******************************************************************************/
605  virtual void setSensorLightPeriodPrv(long period) {
606  _lightSensorPeriodPrv = period;
607  }
608 
609  /*******************************************************************************/
618  /*******************************************************************************/
619  virtual bool getEventLight(sensors_event_t *lightEvent) {
620  (void)lightEvent; // Parameter is intentionally unused in this virtual
621  // function.
622  return false;
623  }
624 
625  /**************************** SENSOR_TYPE: PM10_STD
626  * ****************************/
627  /*********************************************************************************/
634  /*********************************************************************************/
635  virtual long getSensorPM10_STDPeriod() { return _PM10SensorPeriod; }
636 
637  /*********************************************************************************/
644  /*********************************************************************************/
646 
647  /*******************************************************************************/
654  /*******************************************************************************/
655  virtual void setSensorPM10_STDPeriodPrv(long period) {
656  _PM10SensorPeriodPrv = period;
657  }
658 
659  /*******************************************************************************/
668  /*******************************************************************************/
669  virtual bool getEventPM10_STD(sensors_event_t *pm10StdEvent) {
670  (void)pm10StdEvent; // Parameter is intentionally unused in this virtual
671  // function.
672  return false;
673  }
674 
675  /**************************** SENSOR_TYPE: PM25_STD
676  * ****************************/
677  /*********************************************************************************/
684  /*********************************************************************************/
685  virtual long getSensorPM25_STDPeriod() { return _PM25SensorPeriod; }
686 
687  /*********************************************************************************/
694  /*********************************************************************************/
696 
697  /*******************************************************************************/
704  /*******************************************************************************/
705  virtual void setSensorPM25_STDPeriodPrv(long period) {
706  _PM25SensorPeriodPrv = period;
707  }
708 
709  /*******************************************************************************/
718  /*******************************************************************************/
719  virtual bool getEventPM25_STD(sensors_event_t *pm25StdEvent) {
720  (void)pm25StdEvent; // Parameter is intentionally unused in this virtual
721  // function.
722  return false;
723  }
724 
725  /**************************** SENSOR_TYPE: PM100_STD
726  * ****************************/
727  /*********************************************************************************/
734  /*********************************************************************************/
735  virtual long getSensorPM100_STDPeriod() { return _PM100SensorPeriod; }
736 
737  /*********************************************************************************/
744  /*********************************************************************************/
746 
747  /*******************************************************************************/
754  /*******************************************************************************/
755  virtual void setSensorPM100_STDPeriodPrv(long period) {
756  _PM100SensorPeriodPrv = period;
757  }
758 
759  /*******************************************************************************/
768  /*******************************************************************************/
769  virtual bool getEventPM100_STD(sensors_event_t *pm100StdEvent) {
770  (void)pm100StdEvent; // Parameter is intentionally unused in this virtual
771  // function.
772  return false;
773  }
774 
775  /**************************** SENSOR_TYPE: UNITLESS_PERCENT
776  * ****************************/
777  /*********************************************************************************/
784  /*********************************************************************************/
786  return _unitlessPercentPeriod;
787  }
788 
789  /*********************************************************************************/
796  /*********************************************************************************/
799  }
800 
801  /*******************************************************************************/
808  /*******************************************************************************/
809  virtual void setSensorUnitlessPercentPeriodPrv(long period) {
810  _unitlessPercentPeriodPrv = period;
811  }
812 
813  /*******************************************************************************/
822  /*******************************************************************************/
823  virtual bool getEventUnitlessPercent(sensors_event_t *unitlessPercentEvent) {
824  (void)unitlessPercentEvent; // Parameter is intentionally unused in this
825  // virtual function.
826  return false;
827  }
828 
829  /**************************** SENSOR_TYPE: VOLTAGE
830  * ****************************/
831  /*********************************************************************************/
837  /*********************************************************************************/
838  virtual long getSensorVoltagePeriod() { return _voltagePeriod; }
839 
840  /*********************************************************************************/
846  /*********************************************************************************/
847  virtual long getSensorVoltagePeriodPrv() { return _voltagePeriodPrv; }
848 
849  /*******************************************************************************/
855  /*******************************************************************************/
856  virtual void setSensorVoltagePeriodPrv(long period) {
857  _voltagePeriodPrv = period;
858  }
859 
860  /*******************************************************************************/
869  /*******************************************************************************/
870  virtual bool getEventVoltage(sensors_event_t *voltageEvent) {
871  (void)voltageEvent; // Parameter is intentionally unused in this virtual
872  // function.
873  return false;
874  }
875 
876  /**************************** SENSOR_TYPE: CURRENT
877  * ****************************/
878  /*********************************************************************************/
884  /*********************************************************************************/
885  virtual long getSensorCurrentPeriod() { return _currentPeriod; }
886 
887  /*********************************************************************************/
893  /*********************************************************************************/
894  virtual long getSensorCurrentPeriodPrv() { return _currentPeriodPrv; }
895 
896  /*******************************************************************************/
902  /*******************************************************************************/
903  virtual void setSensorCurrentPeriodPrv(long period) {
904  _currentPeriodPrv = period;
905  }
906 
907  /*******************************************************************************/
916  /*******************************************************************************/
917  virtual bool getEventCurrent(sensors_event_t *currentEvent) {
918  (void)currentEvent; // Parameter is intentionally unused in this virtual
919  // function.
920  return false;
921  }
922 
923  /****************************** SENSOR_TYPE: Raw
924  * *******************************/
925  /*********************************************************************************/
931  /*********************************************************************************/
932  virtual long getSensorRawPeriod() { return _rawSensorPeriod; }
933 
934  /*********************************************************************************/
940  /*********************************************************************************/
941  virtual long getSensorRawPeriodPrv() { return _rawSensorPeriodPrv; }
942 
943  /*******************************************************************************/
949  /*******************************************************************************/
950  virtual void setSensorRawPeriodPrv(long period) {
951  _rawSensorPeriodPrv = period;
952  }
953 
954  /*******************************************************************************/
962  /*******************************************************************************/
963  virtual bool getEventRaw(sensors_event_t *rawEvent) {
964  (void)
965  rawEvent; // Parameter is intentionally unused in this virtual function.
966  return false;
967  }
968 
969  /****************************** SENSOR_TYPE: Ambient Temp (°F)
970  * *******************************/
971 
972  /*******************************************************************************/
977  /*******************************************************************************/
978  virtual void disableAmbientTempF() { _ambientTempFPeriod = 0.0L; }
979 
980  /*********************************************************************************/
987  /*********************************************************************************/
989 
990  /*********************************************************************************/
997  /*********************************************************************************/
999  return _ambientTempFPeriodPrv;
1000  }
1001 
1002  /*******************************************************************************/
1010  /*******************************************************************************/
1011  virtual void setSensorAmbientTempFPeriodPrv(long period) {
1012  _ambientTempFPeriodPrv = period;
1013  }
1014 
1015  /*******************************************************************************/
1025  /*******************************************************************************/
1026  virtual bool getEventAmbientTempF(sensors_event_t *AmbientTempFEvent) {
1027  // obtain ambient temp. in °C
1028  if (!getEventAmbientTemp(AmbientTempFEvent))
1029  return false;
1030  // convert event from °C to °F
1031  AmbientTempFEvent->temperature =
1032  (AmbientTempFEvent->temperature * 9.0) / 5.0 + 32;
1033  return true;
1034  }
1035 
1036  /****************************** SENSOR_TYPE: Object Temp (°F)
1037  * *******************************/
1038  /*********************************************************************************/
1045  /*********************************************************************************/
1047 
1048  /*********************************************************************************/
1055  /*********************************************************************************/
1057 
1058  /*******************************************************************************/
1066  /*******************************************************************************/
1067  virtual void setSensorObjectTempFPeriodPrv(long period) {
1068  _objectTempFPeriodPrv = period;
1069  }
1070 
1071  /*******************************************************************************/
1081  /*******************************************************************************/
1082  virtual bool getEventObjectTempF(sensors_event_t *objectTempFEvent) {
1083  // obtain ambient temp. in °C
1084  if (!getEventObjectTemp(objectTempFEvent))
1085  return false;
1086  // convert event from °C to °F
1087  objectTempFEvent->temperature =
1088  (objectTempFEvent->temperature * 9.0) / 5.0 + 32.0;
1089  return true;
1090  }
1091 
1092  /****************************** SENSOR_TYPE: Gas Resistance (ohms)
1093  * *******************************/
1094  /*********************************************************************************/
1101  /*********************************************************************************/
1103 
1104  /*********************************************************************************/
1111  /*********************************************************************************/
1113  return _gasResistancePeriodPrv;
1114  }
1115 
1116  /*******************************************************************************/
1124  /*******************************************************************************/
1125  virtual void setSensorGasResistancePeriodPrv(long period) {
1126  _gasResistancePeriodPrv = period;
1127  }
1128 
1129  /*******************************************************************************/
1138  /*******************************************************************************/
1139  virtual bool getEventGasResistance(sensors_event_t *gasEvent) {
1140  (void)
1141  gasEvent; // Parameter is intentionally unused in this virtual function.
1142  return false;
1143  }
1144 
1145  /****************************** SENSOR_TYPE: NOx Index (index)
1146  * *******************************/
1147  /*********************************************************************************/
1154  /*********************************************************************************/
1155  virtual long getSensorNOxIndexPeriod() { return _NOxIndexPeriod; }
1156 
1157  /*********************************************************************************/
1164  /*********************************************************************************/
1166 
1167  /*******************************************************************************/
1175  /*******************************************************************************/
1176  virtual void setSensorNOxIndexPeriodPrv(long period) {
1177  _NOxIndexPeriodPrv = period;
1178  }
1179 
1180  /*******************************************************************************/
1189  /*******************************************************************************/
1190  virtual bool getEventNOxIndex(sensors_event_t *gasEvent) {
1191  (void)
1192  gasEvent; // Parameter is intentionally unused in this virtual function.
1193  return false;
1194  }
1195 
1196  /****************************** SENSOR_TYPE: VOC Index (index)
1197  * *******************************/
1198  /*********************************************************************************/
1205  /*********************************************************************************/
1206  virtual long getSensorVOCIndexPeriod() { return _VOCIndexPeriod; }
1207 
1208  /*********************************************************************************/
1215  /*********************************************************************************/
1217 
1218  /*******************************************************************************/
1226  /*******************************************************************************/
1227  virtual void setSensorVOCIndexPeriodPrv(long period) {
1228  _VOCIndexPeriodPrv = period;
1229  }
1230 
1231  /*******************************************************************************/
1240  /*******************************************************************************/
1241  virtual bool getEventVOCIndex(sensors_event_t *gasEvent) {
1242  (void)
1243  gasEvent; // Parameter is intentionally unused in this virtual function.
1244  return false;
1245  }
1246 
1247  /**************************** SENSOR_TYPE: PROXIMITY
1248  * ****************************/
1249  /*******************************************************************************/
1253  /*******************************************************************************/
1254  virtual void enableSensorProximity() {};
1255 
1256  /*******************************************************************************/
1260  /*******************************************************************************/
1262 
1263  /*********************************************************************************/
1270  /*********************************************************************************/
1272 
1273  /*******************************************************************************/
1280  /*******************************************************************************/
1281  virtual void setSensorProximityPeriod(long period) {
1282  if (period == 0)
1284  _proximitySensorPeriod = period;
1285  }
1286 
1287  /*********************************************************************************/
1294  /*********************************************************************************/
1296 
1297  /*******************************************************************************/
1304  /*******************************************************************************/
1305  virtual void setSensorProximityPeriodPrv(long period) {
1306  _proximitySensorPeriodPrv = period;
1307  }
1308 
1309  /*******************************************************************************/
1318  /*******************************************************************************/
1319  virtual bool getEventProximity(sensors_event_t *proximityEvent) {
1320  (void)proximityEvent; // Parameter is intentionally unused in this virtual
1321  // function.
1322  return false;
1323  }
1324 
1325  /*******************************************************************************/
1332  /*******************************************************************************/
1333  virtual void updateSensorProximity(float period) {
1334  setSensorProximityPeriod(period);
1335  }
1336 
1337 protected:
1338  TwoWire *_i2c;
1339  uint16_t _sensorAddress;
1341  0L;
1344  long _humidSensorPeriod =
1346  0L;
1349  long _pressureSensorPeriod =
1351  0L;
1354  long _CO2SensorPeriod =
1356  0L;
1360  0L;
1364  0L;
1368  0L;
1371  long _objectTempSensorPeriod = 0L;
1376  long _lightSensorPeriod =
1378  0L;
1381  long _PM10SensorPeriod =
1383  0L;
1387  0L;
1391  0L;
1394  long _unitlessPercentPeriod =
1396  0L;
1399  long _voltagePeriod =
1401  0L;
1404  long _currentPeriod =
1406  0L;
1409  long _rawSensorPeriod =
1411  0L;
1415  long _ambientTempFPeriodPrv =
1418  long _objectTempFPeriod = 0L;
1420  long _objectTempFPeriodPrv =
1423  long _gasResistancePeriod = 0L;
1428  long _NOxIndexPeriod =
1430  0L;
1433  long _VOCIndexPeriod =
1435  0L;
1438  long _proximitySensorPeriod =
1440  0L;
1443 };
1445 
1446 #endif // WipperSnapper_I2C_Driver_H
long _unitlessPercentPeriod
The time period between reading the unitless % sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1395
virtual long getSensorUnitlessPercentPeriodPrv()
Base implementation - Returns the previous time interval at which the unitless % sensor was queried l...
Definition: WipperSnapper_I2C_Driver.h:797
virtual long getSensorLightPeriodPrv()
Base implementation - Returns the previous time interval at which the light sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:595
virtual long getSensorObjectTempPeriodPrv()
Base implementation - Returns the previous time interval at which the object temperature sensor was q...
Definition: WipperSnapper_I2C_Driver.h:543
virtual bool getEventPM10_STD(sensors_event_t *pm10StdEvent)
Base implementation - Reads a object pm10 std. sensor and converts the reading into the expected SI u...
Definition: WipperSnapper_I2C_Driver.h:669
virtual void updateSensorProximity(float period)
Updates the properties of a proximity sensor.
Definition: WipperSnapper_I2C_Driver.h:1333
long _PM10SensorPeriod
The time period between reading the pm25 sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1382
uint16_t getI2CAddress()
Gets the I2C device&#39;s address.
Definition: WipperSnapper_I2C_Driver.h:190
virtual long getSensorPM25_STDPeriod()
Base implementation - Returns the object pm25 standard sensors&#39; period, if set.
Definition: WipperSnapper_I2C_Driver.h:685
virtual void setSensorObjectTempFPeriodPrv(long period)
Sets a timestamp for when the object temperature sensor (°F) was queried.
Definition: WipperSnapper_I2C_Driver.h:1067
long _PM100SensorPeriod
The time period between reading the pm100_std sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1390
#define PERIOD_24HRS_AGO_MILLIS
Used for last sensor read time, initially set 24hrs ago (max period)
Definition: WipperSnapper_I2C_Driver.h:24
virtual void setSensorVOCIndexPeriodPrv(long period)
Sets a timestamp for when the object VOC Index sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:1227
long _currentPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1407
virtual long getSensorPressurePeriod()
Base implementation - Returns the pressure sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:438
virtual long getSensorTVOCPeriodPrv()
Base implementation - Returns the previous time interval at which the TVOC sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:302
virtual void setSensorAmbientTempFPeriodPrv(long period)
Sets a timestamp for when the ambient temperature sensor (°F) was queried.
Definition: WipperSnapper_I2C_Driver.h:1011
virtual bool getEventPM100_STD(sensors_event_t *pm100StdEvent)
Base implementation - Reads a object pm100 std. sensor and converts the reading into the expected SI ...
Definition: WipperSnapper_I2C_Driver.h:769
virtual long getSensorCurrentPeriod()
Base implementation - Returns the current sensor&#39;s period.
Definition: WipperSnapper_I2C_Driver.h:885
virtual long getSensorRelativeHumidityPeriodPrv()
Base implementation - Returns the previous time interval at which the humidity sensor was queried las...
Definition: WipperSnapper_I2C_Driver.h:398
long _altitudeSensorPeriod
The time period between reading the altitude sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1367
virtual long getSensorVOCIndexPeriod()
Base implementation - Returns the VOC Index sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:1206
virtual long getSensorTVOCPeriod()
Base implementation - Returns the TVOC sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:293
virtual void setSensorProximityPeriodPrv(long period)
Sets a timestamp for when the proximity sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:1305
virtual bool getEventCO2(sensors_event_t *co2Event)
Gets a sensor&#39;s CO2 value.
Definition: WipperSnapper_I2C_Driver.h:232
virtual long getSensorAmbientTempPeriod()
Base implementation - Returns the ambient temperature (°C) sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:339
virtual long getSensorPM100_STDPeriodPrv()
Base implementation - Returns the previous time interval at which the pm100 std. sensor was queried l...
Definition: WipperSnapper_I2C_Driver.h:745
virtual long getSensorAmbientTempPeriodPrv()
Base implementation - Returns the previous time interval at which the ambient temperature sensor (°C)...
Definition: WipperSnapper_I2C_Driver.h:349
virtual bool getEventPM25_STD(sensors_event_t *pm25StdEvent)
Base implementation - Reads a object pm25 std. sensor and converts the reading into the expected SI u...
Definition: WipperSnapper_I2C_Driver.h:719
virtual bool getEventNOxIndex(sensors_event_t *gasEvent)
Base implementation - Reads a NOx Index sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:1190
virtual long getSensorECO2PeriodPrv()
Base implementation - Returns the previous time interval at which the eCO2 sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:256
long _currentPeriod
The time period between reading the current sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1405
long _NOxIndexPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1431
long _objectTempSensorPeriod
Definition: WipperSnapper_I2C_Driver.h:1372
long _TVOCSensorPeriod
The time period between reading the TVOC sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1363
long _ambientTempFPeriod
Definition: WipperSnapper_I2C_Driver.h:1414
virtual long getSensorUnitlessPercentPeriod()
Base implementation - Returns the object unitless % sensor period, if set.
Definition: WipperSnapper_I2C_Driver.h:785
virtual long getSensorCO2Period()
Base implementation - Returns the co2 sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:201
virtual void setSensorTVOCPeriodPrv(long period)
Sets a timestamp for when the TVOC sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:311
long _VOCIndexPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1436
virtual void setSensorVoltagePeriodPrv(long period)
Sets a timestamp for when the voltage sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:856
virtual void setSensorAltitudePeriodPrv(long period)
Sets a timestamp for when the Altitude sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:503
virtual bool getEventProximity(sensors_event_t *proximityEvent)
Base implementation - Reads a proximity sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:1319
long _tempSensorPeriod
The time period between reading the temperature sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1340
virtual bool getEventRelativeHumidity(sensors_event_t *humidEvent)
Base implementation - Reads a humidity sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:423
virtual void setSensorNOxIndexPeriodPrv(long period)
Sets a timestamp for when the object NOx Index sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:1176
virtual ~WipperSnapper_I2C_Driver()
Destructor for an I2C sensor.
Definition: WipperSnapper_I2C_Driver.h:54
long _unitlessPercentPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1397
virtual long getSensorAmbientTempFPeriodPrv()
Base implementation - Returns the previous time interval at which the ambient temperature sensor (°F)...
Definition: WipperSnapper_I2C_Driver.h:998
long _voltagePeriod
The time period between reading the voltage sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1400
bool begin()
Initializes the I2C sensor and begins I2C.
Definition: WipperSnapper_I2C_Driver.h:77
virtual long getSensorAmbientTempFPeriod()
Base implementation - Returns the ambient temperature (°F) sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:988
virtual bool getEventAmbientTempF(sensors_event_t *AmbientTempFEvent)
Helper function to obtain a sensor&#39;s ambient temperature value in °F. Requires getEventAmbientTemp() ...
Definition: WipperSnapper_I2C_Driver.h:1026
long _TVOCSensorPeriodPrv
The time when the TVOC sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1365
WipperSnapper_I2C_Driver(TwoWire *i2c, uint16_t sensorAddress)
Instantiates an I2C sensor.
Definition: WipperSnapper_I2C_Driver.h:44
virtual void disableAmbientTempF()
Disables the device&#39;s ambient temperature (°F) sensor, if it exists.
Definition: WipperSnapper_I2C_Driver.h:978
Base class for I2C Drivers.
Definition: WipperSnapper_I2C_Driver.h:32
virtual bool getEventAltitude(sensors_event_t *altitudeEvent)
Base implementation - Reads a Altitude sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:517
long _pressureSensorPeriod
The time period between reading the pressure sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1350
virtual bool getEventVOCIndex(sensors_event_t *gasEvent)
Base implementation - Reads a VOC Index sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:1241
long _objectTempFPeriod
Definition: WipperSnapper_I2C_Driver.h:1419
long _ambientTempFPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1416
long _ECO2SensorPeriodPrv
The time when the eCO2 sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1361
long _gasResistancePeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1426
long _humidSensorPeriod
The time period between reading the humidity sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1345
virtual void setSensorPM100_STDPeriodPrv(long period)
Sets a timestamp for when the light sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:755
virtual long getSensorLightPeriod()
Base implementation - Returns the object light sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:585
long _PM100SensorPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1392
virtual long getSensorRelativeHumidityPeriod()
Base implementation - Returns the humidity sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:389
virtual bool getEventUnitlessPercent(sensors_event_t *unitlessPercentEvent)
Base implementation - Reads a object unitless % std. sensor and converts the reading into the expecte...
Definition: WipperSnapper_I2C_Driver.h:823
virtual long getSensorPM25_STDPeriodPrv()
Base implementation - Returns the previous time interval at which the pm25 std. sensor was queried la...
Definition: WipperSnapper_I2C_Driver.h:695
virtual bool getEventTVOC(sensors_event_t *tvocEvent)
Gets a sensor&#39;s TVOC value.
Definition: WipperSnapper_I2C_Driver.h:324
uint16_t _sensorAddress
The I2C driver&#39;s unique I2C address.
Definition: WipperSnapper_I2C_Driver.h:1339
virtual long getSensorAltitudePeriodPrv()
Base implementation - Returns the previous time interval at which the Altitude sensor was queried las...
Definition: WipperSnapper_I2C_Driver.h:494
virtual void setSensorECO2PeriodPrv(long period)
Sets a timestamp for when the eCO2 sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:265
virtual long getSensorGasResistancePeriodPrv()
Base implementation - Returns the previous time interval at which the gas resistance sensor (ohms) wa...
Definition: WipperSnapper_I2C_Driver.h:1112
long _gasResistancePeriod
Definition: WipperSnapper_I2C_Driver.h:1424
virtual long SensorProximityPeriodPrv()
Base implementation - Returns the previous time interval at which the proximity sensor was queried la...
Definition: WipperSnapper_I2C_Driver.h:1295
virtual long getSensorPM100_STDPeriod()
Base implementation - Returns the object pm100 standard sensors&#39; period, if set.
Definition: WipperSnapper_I2C_Driver.h:735
long _humidSensorPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1347
virtual long getSensorVoltagePeriod()
Base implementation - Returns the voltage sensor&#39;s period.
Definition: WipperSnapper_I2C_Driver.h:838
virtual void setSensorPM10_STDPeriodPrv(long period)
Sets a timestamp for when the light sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:655
long _objectTempSensorPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1374
virtual long getSensorPM10_STDPeriodPrv()
Base implementation - Returns the previous time interval at which the pm10 std. sensor was queried la...
Definition: WipperSnapper_I2C_Driver.h:645
long _objectTempFPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1421
long _lightSensorPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1379
virtual bool getEventECO2(sensors_event_t *eco2Event)
Gets a sensor&#39;s eCO2 value.
Definition: WipperSnapper_I2C_Driver.h:278
virtual void setSensorPM25_STDPeriodPrv(long period)
Sets a timestamp for when the light sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:705
void setSensorPeriod(float period, wippersnapper_i2c_v1_SensorType sensorType)
Sets the sensor&#39;s period, provided a wippersnapper_i2c_v1_SensorType.
Definition: WipperSnapper_I2C_Driver.h:88
virtual void setSensorObjectTempPeriodPrv(long period)
Sets a timestamp for when the object temperature sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:555
virtual long getSensorPressurePeriodPrv()
Base implementation - Returns the previous time interval at which the pressure sensor was queried las...
Definition: WipperSnapper_I2C_Driver.h:447
virtual void setSensorPressurePeriodPrv(long period)
Sets a timestamp for when the pressure sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:456
virtual void setSensorRelativeHumidityPeriodPrv(long periodPrv)
Sets a timestamp for when the temperature sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:409
virtual bool getEventPressure(sensors_event_t *pressureEvent)
Base implementation - Reads a pressure sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:470
virtual long getSensorCurrentPeriodPrv()
Base implementation - Returns the previous time interval at which the current sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:894
virtual long getSensorGasResistancePeriod()
Base implementation - Returns the gas resistance (ohms) sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:1102
virtual long getSensorAltitudePeriod()
Base implementation - Returns the Altitude sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:485
virtual bool getEventLight(sensors_event_t *lightEvent)
Base implementation - Reads a object light sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:619
long _VOCIndexPeriod
The time period between reading the VOC Index sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1434
virtual bool getEventGasResistance(sensors_event_t *gasEvent)
Base implementation - Reads a gas resistance sensor and converts the reading into the expected SI uni...
Definition: WipperSnapper_I2C_Driver.h:1139
virtual bool getEventAmbientTemp(sensors_event_t *tempEvent)
Base implementation - Reads an ambient temperature sensor (°C). Expects value to return in the proper...
Definition: WipperSnapper_I2C_Driver.h:374
virtual long getSensorObjectTempFPeriod()
Base implementation - Returns the object temperature (°F) sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:1046
long _CO2SensorPeriodPrv
The time when the CO2 sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1357
long _lightSensorPeriod
The time period between reading the light sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1377
void configureDriver(wippersnapper_i2c_v1_I2CDeviceInitRequest *msgDeviceInitReq)
Uses an I2CDeviceInitRequest message to configure the sensors belonging to the driver.
Definition: WipperSnapper_I2C_Driver.h:173
virtual void enableSensorProximity()
Enables the device&#39;s proximity sensor, if it exists.
Definition: WipperSnapper_I2C_Driver.h:1254
virtual long getSensorNOxIndexPeriodPrv()
Base implementation - Returns the previous time interval at which the NOx Index sensor was queried la...
Definition: WipperSnapper_I2C_Driver.h:1165
virtual void setSensorUnitlessPercentPeriodPrv(long period)
Sets a timestamp for when the unitless % sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:809
virtual void setSensorCO2PeriodPrv(long period)
Sets a timestamp for when the co2 sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:219
virtual long getSensorRawPeriod()
Base implementation - Returns the raw sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:932
virtual void setSensorRawPeriodPrv(long period)
Sets a timestamp for when the raw sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:950
virtual long getSensorObjectTempPeriod()
Base implementation - Returns the object temperature sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:533
virtual void setSensorAmbientTempPeriodPrv(long periodPrv)
Sets a timestamp for when the ambient temperature sensor (°C) was queried.
Definition: WipperSnapper_I2C_Driver.h:360
long _voltagePeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1402
long _rawSensorPeriod
The time period between reading the Raw sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1410
virtual long getSensorCO2PeriodPrv()
Base implementation - Returns the previous time interval at which the co2 sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:210
virtual long getSensorECO2Period()
Base implementation - Returns the eCO2 sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:247
virtual void disableSensorProximity()
Disables the device&#39;s object proximity sensor, if it exists.
Definition: WipperSnapper_I2C_Driver.h:1261
virtual bool getEventObjectTempF(sensors_event_t *objectTempFEvent)
Helper function to obtain a sensor&#39;s object temperature value in °F. Requires getEventObjectTemp() to...
Definition: WipperSnapper_I2C_Driver.h:1082
long _rawSensorPeriodPrv
The time when the Raw sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1412
long _PM25SensorPeriod
The time period between reading the pm25 sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1386
long _tempSensorPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1342
long _PM10SensorPeriodPrv
The time when the pm25 sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1384
long _CO2SensorPeriod
The time period between reading the CO2 sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1355
virtual long getSensorPM10_STDPeriod()
Base implementation - Returns the object pm10 standard sensors&#39; period, if set.
Definition: WipperSnapper_I2C_Driver.h:635
virtual long getSensorObjectTempFPeriodPrv()
Base implementation - Returns the previous time interval at which the object temperature sensor (°F) ...
Definition: WipperSnapper_I2C_Driver.h:1056
long _proximitySensorPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1441
virtual bool getEventObjectTemp(sensors_event_t *objectTempEvent)
Base implementation - Reads a object temperature sensor and converts the reading into the expected SI...
Definition: WipperSnapper_I2C_Driver.h:569
virtual long getSensorVoltagePeriodPrv()
Base implementation - Returns the previous time interval at which the voltage sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:847
long _ECO2SensorPeriod
The time period between reading the eCO2 sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1359
long _proximitySensorPeriod
The time period between reading the proximity sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1439
virtual long getSensorRawPeriodPrv()
Base implementation - Returns the previous time interval at which the raw sensor was queried last...
Definition: WipperSnapper_I2C_Driver.h:941
virtual void setSensorCurrentPeriodPrv(long period)
Sets a timestamp for when the current sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:903
long _PM25SensorPeriodPrv
The time when the pm25 sensor was last read.
Definition: WipperSnapper_I2C_Driver.h:1388
virtual bool getEventRaw(sensors_event_t *rawEvent)
Gets a sensor&#39;s Raw value.
Definition: WipperSnapper_I2C_Driver.h:963
virtual long sensorProximityPeriod()
Base implementation - Returns the proximity sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:1271
virtual bool getEventCurrent(sensors_event_t *currentEvent)
Base implementation - Reads a current sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:917
virtual void setSensorGasResistancePeriodPrv(long period)
Sets a timestamp for when the object gas resistance sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:1125
long _altitudeSensorPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1369
virtual long getSensorVOCIndexPeriodPrv()
Base implementation - Returns the previous time interval at which the VOC Index sensor was queried la...
Definition: WipperSnapper_I2C_Driver.h:1216
long _NOxIndexPeriod
The time period between reading the NOx Index sensor&#39;s value.
Definition: WipperSnapper_I2C_Driver.h:1429
virtual bool getEventVoltage(sensors_event_t *voltageEvent)
Base implementation - Reads a voltage sensor and converts the reading into the expected SI unit...
Definition: WipperSnapper_I2C_Driver.h:870
TwoWire * _i2c
Pointer to the I2C driver&#39;s Wire object.
Definition: WipperSnapper_I2C_Driver.h:1338
virtual void fastTick()
Lightweight, per-update background hook for drivers that need more frequent internal polling than the...
Definition: WipperSnapper_I2C_Driver.h:69
long _pressureSensorPeriodPrv
Definition: WipperSnapper_I2C_Driver.h:1352
virtual long getSensorNOxIndexPeriod()
Base implementation - Returns the NOx Index sensor&#39;s period, if set.
Definition: WipperSnapper_I2C_Driver.h:1155
virtual void setSensorLightPeriodPrv(long period)
Sets a timestamp for when the light sensor was queried.
Definition: WipperSnapper_I2C_Driver.h:605
virtual void setSensorProximityPeriod(long period)
Set the proximity sensor&#39;s return frequency.
Definition: WipperSnapper_I2C_Driver.h:1281