MakeBlock Drive Updated
Updated library for MakeBlock Ranger
Loading...
Searching...
No Matches
MePm25Sensor Class Reference

Driver for Me PM2.5 sensor device. More...

#include <src/MePm25Sensor.h>

Inheritance diagram for MePm25Sensor:
Collaboration diagram for MePm25Sensor:

Public Member Functions

 MePm25Sensor ()
 
 MePm25Sensor (uint8_t port)
 
uint16_t readPm1_0Concentration (void)
 
uint16_t readPm2_5Concentration (void)
 
uint16_t readPm10Concentration (void)
 
uint16_t read0_3NumIn100ml (void)
 
uint16_t read0_5NumIn100ml (void)
 
uint16_t read1_0NumIn100ml (void)
 
uint16_t read2_5NumIn100ml (void)
 
uint16_t read5_0NumIn100ml (void)
 
uint16_t read10NumIn100ml (void)
 
uint16_t setOuputCompatibility (void)
 
uint16_t turnOnFanLaser (void)
 
uint16_t turnOffFanLaser (void)
 
uint16_t OutputIntimeOn (void)
 
uint16_t OutputIntimeOff (void)
 
uint16_t setOutputIntimePeriod (uint16_t settime)
 
uint16_t askForData (void)
 
uint16_t coreSelfTest (void)
 
uint16_t returnCoreSelfTest (void)
 
uint16_t setCoreSelfTestTime (uint8_t settime)
 
uint16_t setCoreEfficient (uint8_t efficent)
 
void rxloop (void)
 
uint16_t returnlen (void)
 
uint16_t returnchecksum (void)
 
- Public Member Functions inherited from MeSerial
 MeSerial (void)
 
 MeSerial (uint8_t port)
 
 MeSerial (uint8_t receivePin, uint8_t transmitPin, bool inverse_logic=false)
 
void setHardware (bool mode)
 
void begin (long baudrate)
 
size_t write (uint8_t byte)
 
int read ()
 
int available ()
 
int16_t poll (void)
 
void end (void)
 
bool listen (void)
 
bool isListening (void)
 
void sendString (char *str)
 
void printf (char *fmt,...)
 
boolean dataLineAvailable (void)
 
String readDataLine (void)
 
String concatenateWith (String s1, String s2)
 
char letterOf (int i, String s)
 
int stringLength (String s)
 
boolean equalString (String s1, String s2)
 
float getValue (String key)
 
- Public Member Functions inherited from MePort
 MePort (void)
 
 MePort (uint8_t port)
 
 MePort (uint8_t port, uint8_t slot)
 
uint8_t getPort (void)
 
uint8_t getSlot (void)
 
bool dRead1 (uint8_t mode=INPUT)
 
bool dRead2 (uint8_t mode=INPUT)
 
bool dpRead1 (void)
 
bool dpRead2 (void)
 
void dWrite1 (bool value)
 
void dWrite2 (bool value)
 
int16_t aRead1 (void)
 
int16_t aRead2 (void)
 
void aWrite1 (int16_t value)
 
void aWrite2 (int16_t value)
 
void reset (uint8_t port)
 
void reset (uint8_t port, uint8_t slot)
 
uint8_t pin1 (void)
 
uint8_t pin2 (void)
 
uint8_t pin (void)
 
uint8_t pin (uint8_t port, uint8_t slot)
 
- Public Member Functions inherited from SoftwareSerial
 SoftwareSerial (uint8_t receivePin, uint8_t transmitPin, bool inverse_logic=false)
 
void begin (long speed)
 
bool listen ()
 
void end ()
 
bool isListening ()
 
bool stopListening ()
 
bool overflow ()
 
int peek ()
 
virtual void flush ()
 
 operator bool ()
 

Additional Inherited Members

- Static Public Member Functions inherited from SoftwareSerial
static void handle_interrupt () __attribute__((__always_inline__))
 
- Protected Attributes inherited from MeSerial
bool _hard
 
bool _polling
 
bool _scratch
 
int16_t _bitPeriod
 
int16_t _byte
 
long _lastTime
 
char buffer [64]
 
String lastLine
 
int bufferIndex
 
- Protected Attributes inherited from MePort
uint8_t s1
 
uint8_t s2
 
uint8_t _port
 
uint8_t _slot
 

Detailed Description

Driver for Me PM2.5 sensor device.

Class: MePm25Sensor

Description
Declaration of Class MePm25Sensor.
Copyright (C), 2012-2016, MakeBlock

Constructor & Destructor Documentation

◆ MePm25Sensor() [1/2]

MePm25Sensor::MePm25Sensor ( )

Alternate Constructor which can call your own function to map the Me Smart Servo to arduino port, no pins are used or initialized here.

Parameters
[in]None

◆ MePm25Sensor() [2/2]

MePm25Sensor::MePm25Sensor ( uint8_t  port)

Alternate Constructor which can call your own function to map the Me Smart Servo to arduino port, If the hardware serial was selected, it will used the hardware serial.

Parameters
[in]port- RJ25 port from PORT_1 to M2

Alternate Constructor which can call your own function to map the Me Smart Servo to arduino port, If the hardware serial was selected, it will used the hardware serial.

Parameters
[in]port- RJ25 port from PORT_1 to M2.

Member Function Documentation

◆ askForData()

uint16_t MePm25Sensor::askForData ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ coreSelfTest()

uint16_t MePm25Sensor::coreSelfTest ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ OutputIntimeOff()

uint16_t MePm25Sensor::OutputIntimeOff ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ OutputIntimeOn()

uint16_t MePm25Sensor::OutputIntimeOn ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ read0_3NumIn100ml()

uint16_t MePm25Sensor::read0_3NumIn100ml ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ read0_5NumIn100ml()

uint16_t MePm25Sensor::read0_5NumIn100ml ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ read10NumIn100ml()

uint16_t MePm25Sensor::read10NumIn100ml ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ read1_0NumIn100ml()

uint16_t MePm25Sensor::read1_0NumIn100ml ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ read2_5NumIn100ml()

uint16_t MePm25Sensor::read2_5NumIn100ml ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ read5_0NumIn100ml()

uint16_t MePm25Sensor::read5_0NumIn100ml ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ readPm10Concentration()

uint16_t MePm25Sensor::readPm10Concentration ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ readPm1_0Concentration()

uint16_t MePm25Sensor::readPm1_0Concentration ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ readPm2_5Concentration()

uint16_t MePm25Sensor::readPm2_5Concentration ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ returnchecksum()

uint16_t MePm25Sensor::returnchecksum ( void  )
Function
smartServoEventHandle
Description
This function is used to process protocol messages of smart servo.
Parameters
[in]None
Output
None
Returns
None
Others
None

◆ returnCoreSelfTest()

uint16_t MePm25Sensor::returnCoreSelfTest ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ returnlen()

uint16_t MePm25Sensor::returnlen ( void  )
Function
smartServoEventHandle
Description
This function is used to process protocol messages of smart servo.
Parameters
[in]None
Output
None
Returns
None
Others
None

◆ rxloop()

void MePm25Sensor::rxloop ( void  )
Function
smartServoEventHandle
Description
This function is used to process protocol messages of smart servo.
Parameters
[in]None
Output
None
Returns
None
Others
None

◆ setCoreEfficient()

uint16_t MePm25Sensor::setCoreEfficient ( uint8_t  efficent)
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ setCoreSelfTestTime()

uint16_t MePm25Sensor::setCoreSelfTestTime ( uint8_t  settime)
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ setOuputCompatibility()

uint16_t MePm25Sensor::setOuputCompatibility ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ setOutputIntimePeriod()

uint16_t MePm25Sensor::setOutputIntimePeriod ( uint16_t  settime)
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ turnOffFanLaser()

uint16_t MePm25Sensor::turnOffFanLaser ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

◆ turnOnFanLaser()

uint16_t MePm25Sensor::turnOnFanLaser ( void  )
Function
readByte
Description
change 2byte 7bit read date to 1byte byte data.
Parameters
[in]*argv- the buffer for input data.
[in]idx- the index used to identify the first address of read data.
Output
return the converted data.
Returns
None
Others
None

The documentation for this class was generated from the following files: