Added comments

This commit is contained in:
miguel5612
2019-05-29 20:41:04 -05:00
parent 1a4c91528d
commit 1924e21e61
3 changed files with 24 additions and 5 deletions

View File

@ -20,18 +20,32 @@
#define pin A0 //Analog input 0 of your arduino
#define type 2 //MQ2
/***************************** MQInicializar****************************************
Input: pin, type
Output:
Remarks: This function create the sensor object.
************************************************************************************/
//Declare Sensor
MQUnifiedsensor MQ2(pin, type);
void setup() {
//Init serial port
Serial.begin(115200);
/***************************** MQInicializar****************************************
Input:
Output:
Remarks: This function configure the pinMode
************************************************************************************/
//init the sensor
MQ2.inicializar();
}
void loop() {
void loop() {
/***************************** MQReadSensor ****************************************
Input: Gas - Serial print flag
Output: Value in PPM
Remarks: This function use readPPM to read the value in PPM the gas in the air.
************************************************************************************/
//Read the sensor and print in serial port
int lecture = MQ2.readSensor("", true);
delay(400);