File tree 4 files changed +21
-15
lines changed
4 files changed +21
-15
lines changed Original file line number Diff line number Diff line change 4
4
Date : Octover 2024
5
5
*/
6
6
7
- #include " Arduino .h"
7
+ #include " WindQX .h"
8
8
9
9
WindQX::WindQX () {
10
10
}
11
11
12
- bool WindQX::Initialize () {
12
+ void WindQX::Initialize () {
13
13
Serial.begin (115200 );
14
- return True;
15
14
}
16
15
17
16
String WindQX::getData () {
@@ -24,8 +23,7 @@ String WindQX::getData() {
24
23
String FRAME;
25
24
26
25
FRAME = Serial.readStringUntil (' \n ' ); // Read the FRAME until a line break is found
27
- Serial.println (FRAME);
28
-
26
+
29
27
// Divide the frame into its components separated by spaces.
30
28
int values[4 ];
31
29
int counter = 0 ;
@@ -45,7 +43,7 @@ String WindQX::getData() {
45
43
// measures calibration
46
44
_temperatureDeg = TEMP / 100 - 40 ;
47
45
_windKH = WSPE / 10 ;
48
- if (wind > 200 ) {
46
+ if (_windKH > 200 ) {
49
47
_windKH = 0 ;
50
48
_status = " Wet sensor" ;
51
49
return " KO" ;
@@ -61,6 +59,8 @@ String WindQX::getData() {
61
59
return " KO" ;
62
60
}
63
61
}
62
+ _status = " Not connected" ;
63
+ return " KO" ;
64
64
}
65
65
66
66
float WindQX::getWind () {
Original file line number Diff line number Diff line change 4
4
Date : Octover 2024
5
5
*/
6
6
7
- #include " Arduino.h"
8
-
9
7
#ifndef WINDQX_H
10
8
#define WINDQX_H
11
9
10
+ #include " Arduino.h"
11
+
12
12
class WindQX {
13
+ private:
14
+ float _windKH;
15
+ float _temperatureDeg;
16
+ String _status;
13
17
public:
14
18
WindQX ();
15
- bool Initialize ();
19
+ void Initialize ();
16
20
String getData ();
17
21
float getWind ();
18
22
float getTemperature ();
19
23
String getStatus ();
20
-
21
- float _windKH;
22
- float _temperatureDeg;
23
- String _status;
24
24
};
25
25
26
26
#endif
Original file line number Diff line number Diff line change 3
3
# Datatypes (KEYWORD1)
4
4
WindQX KEYWORD1
5
5
6
+ # Methods and Functions (KEYWORD2)
7
+ Initialize KEYWORD2
8
+ getData KEYWORD2
9
+ getWind KEYWORD2
10
+ getTemperature KEYWORD2
11
+ getStatus KEYWORD2
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ name=WindQX_Library
2
2
version =1.0.0
3
3
author =Carlos Orts <
[email protected] >
4
4
maintainer =Carlos Orts <
[email protected] >
5
- sentence =Arduino library to read WindQX anemometers IoT devices from ECD (e.g. SA.01) using serial .
6
- paragraph =Over serial line implementation (OSI 2/OSI 1 )
5
+ sentence =Serial WindQX´s solid state anemometers library .
6
+ paragraph =It measures the wind speed and the temperature from IoT devices made by ECD (e.g. SA.01 )
7
7
category =Sensors
8
8
url =https://github.com/McOrts/WindQX_Library
9
9
architectures =*
You can’t perform that action at this time.
0 commit comments