#include WaspSensorCities_PRO.h
Gas gas_sensor(SOCKET_B);
gas_sensor.ON();
gas_sensor.getConc();
gas_sensor.OFF();
bmeCitiesSensor bme(SOCKET_A);
bme.ON();
bme.getTemperature();
bme.getHumidity();
bme.getPressure();
bme.OFF();
The getTemperature(), getHumidity()
and getPressure()
functions return:luxesCitiesSensor luxes(SOCKET_E);
luxes.ON();
luxes.getLuminosity();
luxes.OFF();
getLuminosity()
function returns:ultrasoundCitiesSensor ultrasound(SOCKET_E);
ultrasound.ON();
ultrasound.getDistance();
ultrasound.OFF();
getDistance()
function returns:#include WaspPM.h
_bin[24]
getPM()
_binL[16]
getPM()
_binH[8]
getPM()
_temp
getPM()
_hum
getPM()
_bin1_MToF
getPM()
_bin3_MToF
getPM()
_bin5_MToF
getPM()
_bin7_MToF
getPM()
_PM1
getPM()
_PM2_5
getPM()
_PM10
getPM()
_opcModel
getPM()
_temp
and _hum
variables are not available for OPC_N2 sensor. The OPC_N2 sensor measure 16 bins instead of 24. Consequently, the _binH
variable and the last 8 bytes of the _bin
variable will be zero.PM.ON();
ON()
function must include the parameter '0'
or PM_SPI_MODE
. So, the function to use should be:PM.ON(0);
PM.ON(PM_SPI_MODE);
PM.OFF();
getPM(timeSample)
and getPM(waitSample, timeSample)
perform a measure of the particles from the atmosphere. timeSample
is the period in milliseconds to sample the air absorbed by the built-in fan. waitSample
is a time in milliseconds with the fan powered on before the sample measurement.// Reads PM and bin values with a period of 5 seconds
PM.getPM(5000);
// Reads PM and bin values with a period of 9 seconds and a wait sample of 5 seconds
PM.getPM(5000, 9000);
_bin
_binL
_binH
_temp
_hum
_bin1_MToF
_bin3_MToF
_bin5_MToF
_bin7_MToF
_PM1
_PM2_5
_PM10
_opcModel
getInfoString(string_pointer)
and passing a string pointer as parameter. The information will be stored in the string pointer.char information[61];
// Reads the configuration variables
PM.getInfoString(information);
// Prints the string
USB.println(information);
readSerialNumber(string_pointer)
and passing a string pointer as parameter. The information will be stored in the string pointer.char serial_number[61];
// Reads the serial number
PM.readSerialNumber(serial_number);
// Prints the string
USB.println(serial_number);