MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
MeGasSensor.h
Go to the documentation of this file.
1
39#ifndef MeGasSensor_H
40#define MeGasSensor_H
41
42#include <stdint.h>
43#include <stdbool.h>
44#include <Arduino.h>
45#include "MeConfig.h"
46
47
48#ifdef ME_PORT_DEFINED
49#include "MePort.h"
50#endif // ME_PORT_DEFINED
51
52#define Gas_Exceeded (0x00)
53#define Gas_not_Exceeded (0x01)
54
60#ifndef ME_PORT_DEFINED
61 class MeGasSensor
62#else // !ME_PORT_DEFINED
63class MeGasSensor : public MePort
64#endif // !ME_PORT_DEFINED
65{
66 public:
67#ifdef ME_PORT_DEFINED
74 MeGasSensor(void);
75
81 MeGasSensor(uint8_t port);
82#else // ME_PORT_DEFINED
91 MeGasSensor(uint8_t digital_pin,uint8_t analog_pin)
92#endif // ME_PORT_DEFINED
109 void setpin(uint8_t digital_pin,uint8_t analog_pin);
110
125 uint8_t readDigital(void);
126
139 int16_t readAnalog(void);
140 private:
141 volatile uint8_t _digital_pin;
142 volatile uint8_t _analog_pin;
143};
144#endif
145
MeConfig.h
Configuration file of library.
MePort.h
Header for MePort.cpp module.
MeGasSensor
Driver for Me gas snesor device.
Definition MeGasSensor.h:65
MeGasSensor::MeGasSensor
MeGasSensor(void)
Definition MeGasSensor.cpp:49
MeGasSensor::readAnalog
int16_t readAnalog(void)
Definition MeGasSensor.cpp:142
MeGasSensor::readDigital
uint8_t readDigital(void)
Definition MeGasSensor.cpp:121
MePort
Port Mapping for RJ25.
Definition MePort.h:128