grove grove (GL5528 LDR) Light sensor class
Spaniakos - grove (GL5528 LDR) Light sensor class
LightSensor.h
1 /*
2  Copyright (C) 2014 G. Spanos <spaniakos@gmail.com
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public License
6  version 2 as published by the Free Software Foundation.
7  */
8 
15 #ifndef __LightSensor_H__
16 #define __LightSensor_H__
17 
18 #include "LightSensor_config.h"
19 
21  private:
22  uint8_t pinLight;
23  int LUX;
25  int Old_LUX;
26  float Rensor;
28  public:
35  LightSensor(uint8_t pin,int thres);
36 
43  LightSensor(uint8_t pin); /*thres = 1*/
44 
49  void begin(void);
50 
54  void Read_Light(void);
55 
62  void Light_To_Lux(void);
63 
67  void Save_Old(void);
68 
72  int cmp_values(void);
73 
77  int Value(void);
78 
82  int Old_Value(void);
83 
87  void CalcRensor();
88 
92  float get_Rensor();
93 
97  int get_Threshold();
98 
102  void calibrate();
103 };
104 
149 #endif //LightSensor
150 
151 
void Save_Old(void)
Definition: LightSensor.cpp:53
uint8_t pinLight
Definition: LightSensor.h:22
void CalcRensor()
Definition: LightSensor.cpp:78
int get_Threshold()
Definition: LightSensor.cpp:89
void Read_Light(void)
Definition: LightSensor.cpp:36
int Value(void)
Definition: LightSensor.cpp:70
int sensorValue
Definition: LightSensor.h:24
int Old_LUX
Definition: LightSensor.h:25
void begin(void)
Definition: LightSensor.cpp:32
void calibrate()
Definition: LightSensor.cpp:93
float get_Rensor()
Definition: LightSensor.cpp:85
int cmp_values(void)
Definition: LightSensor.cpp:60
int LUX
Definition: LightSensor.h:23
void Light_To_Lux(void)
Definition: LightSensor.cpp:43
Definition: LightSensor.h:20
LightSensor(uint8_t pin, int thres)
Definition: LightSensor.cpp:14
int LightThres
Definition: LightSensor.h:27
int Old_Value(void)
Definition: LightSensor.cpp:74
float Rensor
Definition: LightSensor.h:26