From ed3e1f7d8db46fc5945fd96c02cad7167e09e915 Mon Sep 17 00:00:00 2001 From: worawit sayned Date: Sun, 6 Aug 2023 20:42:35 +0700 Subject: [PATCH] update and fix wording function --- .../Magellan_extension_stardardcode.ino | 2 +- examples/Soil_moisture/Soil_moisture.ino | 2 +- keywords.txt | 2 +- src/Modules/SOIL_MOISTURE.cpp | 2 +- src/Modules/SOIL_MOISTURE.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/Magellan_extension_stardardcode/Magellan_extension_stardardcode.ino b/examples/Magellan_extension_stardardcode/Magellan_extension_stardardcode.ino index 2ac021b..d62d27b 100644 --- a/examples/Magellan_extension_stardardcode/Magellan_extension_stardardcode.ino +++ b/examples/Magellan_extension_stardardcode/Magellan_extension_stardardcode.ino @@ -80,7 +80,7 @@ void loop() float LightMeter = extLightMeter.readLight(); float Sht20Temp = extSHT20.readTemperature(); float Sht20Humid = extSHT20.readHumidity(); - float SoilMoisture = extSoilMoisture.readMoisetureLevel(); + float SoilMoisture = extSoilMoisture.readMoistureLevel(); float BoardTemp = magel.builtInSensor.readTemperature(); float BoardHumid = magel.builtInSensor.readHumidity(); if (magel.gps.available()) diff --git a/examples/Soil_moisture/Soil_moisture.ino b/examples/Soil_moisture/Soil_moisture.ino index aaf8b20..8bba928 100644 --- a/examples/Soil_moisture/Soil_moisture.ino +++ b/examples/Soil_moisture/Soil_moisture.ino @@ -14,6 +14,6 @@ void setup() void loop() { Serial.print("Soil Moisture Level: "); - Serial.println(extSoilMoisture.readMoisetureLevel(), 1); + Serial.println(extSoilMoisture.readMoistureLevel(), 1); delay(2000); } \ No newline at end of file diff --git a/keywords.txt b/keywords.txt index b6fe7fd..5d40858 100644 --- a/keywords.txt +++ b/keywords.txt @@ -27,7 +27,7 @@ getDateTimeString KEYWORD2 extConfig KEYWORD2 calibrateSensor KEYWORD2 readRawMillivolt KEYWORD2 -readMoisetureLevel KEYWORD2 +readMoistureLevel KEYWORD2 readTemperature KEYWORD2 readHumidity KEYWORD2 heatSensor KEYWORD2 diff --git a/src/Modules/SOIL_MOISTURE.cpp b/src/Modules/SOIL_MOISTURE.cpp index 4d4bca6..8eebbf1 100644 --- a/src/Modules/SOIL_MOISTURE.cpp +++ b/src/Modules/SOIL_MOISTURE.cpp @@ -47,7 +47,7 @@ float SOIL_MOISTURE::readRawMillivolt() return (float)analogRead(this->_analogPin); } -float SOIL_MOISTURE::readMoisetureLevel() +float SOIL_MOISTURE::readMoistureLevel() { int rawAnalog = readRawMillivolt(); float moistureLevel = map(rawAnalog, this->_dry_millivolt, this->_wet_millivolt, 0, 100) / 10.0; diff --git a/src/Modules/SOIL_MOISTURE.h b/src/Modules/SOIL_MOISTURE.h index 21fbf4f..0ccf6b3 100644 --- a/src/Modules/SOIL_MOISTURE.h +++ b/src/Modules/SOIL_MOISTURE.h @@ -17,7 +17,7 @@ class SOIL_MOISTURE void begin(AIN anlogINPUT); void calibrateSensor(int WET_MILLIVOLT, int DRY_MILLIVOLT); float readRawMillivolt(); - float readMoisetureLevel(); + float readMoistureLevel(); }; extern SOIL_MOISTURE extSoilMoisture;