MakeBlock Drive Updated Updated library for MakeBlock Ranger

Loading...
Searching...
No Matches
MeLightSensor.h
Go to the documentation of this file.
1
41/* Define to prevent recursive inclusion -------------------------------------*/
42#ifndef MeLightSensor_H
43#define MeLightSensor_H
44
45/* Includes ------------------------------------------------------------------*/
46#include <stdint.h>
47#include <stdbool.h>
48#include <Arduino.h>
49#include "MeConfig.h"
50
51#ifdef ME_PORT_DEFINED
52#include "MePort.h"
53#endif // ME_PORT_DEFINED
54
60#ifndef ME_PORT_DEFINED
61 class MeLightSensor
62#else // !ME_PORT_DEFINED
63class MeLightSensor : public MePort
64#endif // !ME_PORT_DEFINED
65{
66 public:
67#ifdef ME_PORT_DEFINED
74 MeLightSensor(void);
75
81 MeLightSensor(uint8_t port);
82#else // ME_PORT_DEFINED
90 MeLightSensor(uint8_t ledPin, uint8_t sensorPin);
91#endif // ME_PORT_DEFINED
110 void setpin(uint8_t ledPin, uint8_t sensorPin);
111
125 int16_t read(void);
126
140 void lightOn(void);
141
155 void lightOff(void);
156 private:
157 uint8_t _ledPin;
158 uint8_t _sensorPin;
159};
160
161#endif // MeLightSensor_H
MeConfig.h
Configuration file of library.
MePort.h
Header for MePort.cpp module.
MeLightSensor
Driver for Me-Light Sensor module.
Definition MeLightSensor.h:65
MeLightSensor::lightOff
void lightOff(void)
Definition MeLightSensor.cpp:181
MeLightSensor::MeLightSensor
MeLightSensor(void)
Definition MeLightSensor.cpp:57
MeLightSensor::read
int16_t read(void)
Definition MeLightSensor.cpp:136
MeLightSensor::lightOn
void lightOn(void)
Definition MeLightSensor.cpp:159
MePort
Port Mapping for RJ25.
Definition MePort.h:128