A brief overview of the functionality of this package follows below. For a more thorough overview, please check out the [python version of this code][1].
chip_select: Chip Select pin for SPI communication.
Returns: An instance of the OPCN2 class.
Issues the
check_status
command and returns true if a connection is good.
Turn on the OPC laser and fan. Returns
true
if it works.
Turn off the OPC laser and fan. Returns
true
if it works.
NOT IMPLEMENTED (yet)
NOT IMPLEMENTED (yet)
NOT IMPLEMENTED (yet)
Saves the configuration variables once changed. To be used in conjunction with
enter_bootloader
.
Returns: boolean (true if successfull).
Enter into the bootloader to make permanent changes to configuration variables. Use only if you know what you're doing!
Returns: boolean (true if successfull).
value: a uint8_t that corresponds to the desired fan power. Permitted values are between 0 - 255.
Returns: boolean (true if successfull).
value: a uint8_t that corresponds to the desired laser power. Permitted values are between 0 - 255.
Returns: boolean (true if successfull).
state: true to turn the fan on, and false to turn it off.
Returns: boolean (true if successfull).
state: true to turn the laser on, and false to turn it off.
Returns: boolean (true if successfull).
Returns a String containing the OPC firmware version and serial number.
Only available for firmware versions >= 18
Returns: a String containing the serial number.
Returns: a structure containing:
Firmware.major
andFirmware.minor
.
Only available for firmware versions >= 18
Returns: structure containing:
Status.fanON
,Status.laserON
,Status.fanDAC
, andStatus.laserDAC
.
Returns: the ConfigVars structure which contains:
ConfigVars.bb0
-ConfigVars.bb14
,ConfigVars.bpv0
-ConfigVars.bpv15
,ConfigVars.bpd0
-ConfigVars.bpd15
,ConfigVars.bsvw0
-ConfigVars.bsvw15
,ConfigVars.gsc
,ConfigVars.sfr
,ConfigVars.laser_dac
,ConfigVars.fan_dac
, andConfigVars.tof_sfr
.
Only available for firmware versions >= 18
Returns: the ConfigVars2 structure which contains:
ConfigVars2.AMSamplingInterval
,ConfigVars2.AMIntervalCount
,ConfigVars2.AMFanOnIdle
,ConfigVars2.AMLaserOnIdle
,ConfigVars2.AMMaxDataArraysInFile
, andConfigVars2.AMOnlySavePMData
.
Only available for firmware versions >= 18
Returns: the PMData structure containing:
PMData.pm1
,PMData.pm25
, andPMData.pm10
.
convert_to_conc: (boolean) If true, the raw histogram is converted to concentration (#/cm3) by dividing the raw value by the product of the sampling period and the sample flow rate.
Returns: the HistogramData structure containing:
period
,sfr
,bin0
-bin15
,bin1MToF
,bin3MToF
,bin5MToF
,bin7MToF
,temp_pressure
,checksum
,pm1
,pm25
, andpm10
.