Skip to content

Commit adec614

Browse files
committed
v1.0.0
1 parent 09ce326 commit adec614

File tree

4 files changed

+21
-15
lines changed

4 files changed

+21
-15
lines changed

WindQX.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@
44
Date : Octover 2024
55
*/
66

7-
#include "Arduino.h"
7+
#include "WindQX.h"
88

99
WindQX::WindQX() {
1010
}
1111

12-
bool WindQX::Initialize() {
12+
void WindQX::Initialize() {
1313
Serial.begin(115200);
14-
return True;
1514
}
1615

1716
String WindQX::getData() {
@@ -24,8 +23,7 @@ String WindQX::getData() {
2423
String FRAME;
2524

2625
FRAME = Serial.readStringUntil('\n'); // Read the FRAME until a line break is found
27-
Serial.println(FRAME);
28-
26+
2927
// Divide the frame into its components separated by spaces.
3028
int values[4];
3129
int counter = 0;
@@ -45,7 +43,7 @@ String WindQX::getData() {
4543
// measures calibration
4644
_temperatureDeg = TEMP / 100 - 40;
4745
_windKH = WSPE / 10;
48-
if (wind > 200) {
46+
if (_windKH > 200) {
4947
_windKH = 0;
5048
_status = "Wet sensor";
5149
return "KO";
@@ -61,6 +59,8 @@ String WindQX::getData() {
6159
return "KO";
6260
}
6361
}
62+
_status = "Not connected";
63+
return "KO";
6464
}
6565

6666
float WindQX::getWind() {

WindQX.h

+7-7
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
Date : Octover 2024
55
*/
66

7-
#include "Arduino.h"
8-
97
#ifndef WINDQX_H
108
#define WINDQX_H
119

10+
#include "Arduino.h"
11+
1212
class WindQX {
13+
private:
14+
float _windKH;
15+
float _temperatureDeg;
16+
String _status;
1317
public:
1418
WindQX();
15-
bool Initialize();
19+
void Initialize();
1620
String getData();
1721
float getWind();
1822
float getTemperature();
1923
String getStatus();
20-
21-
float _windKH;
22-
float _temperatureDeg;
23-
String _status;
2424
};
2525

2626
#endif

keywords.txt

+6
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
# Datatypes (KEYWORD1)
44
WindQX KEYWORD1
55

6+
# Methods and Functions (KEYWORD2)
7+
Initialize KEYWORD2
8+
getData KEYWORD2
9+
getWind KEYWORD2
10+
getTemperature KEYWORD2
11+
getStatus KEYWORD2

library.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name=WindQX_Library
22
version=1.0.0
33
author=Carlos Orts <[email protected]>
44
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)
77
category=Sensors
88
url=https://github.com/McOrts/WindQX_Library
99
architectures=*

0 commit comments

Comments
 (0)