Skip to content

Commit 517a880

Browse files
committed
formatter; changed read delay to something quicker
1 parent a2ff64a commit 517a880

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

examples/Example_03_LEDFlashMoisture/Example_03_LEDFlashMoisture.ino

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
*
66
* SPDX-License-Identifier: MIT
77
*
8-
* This example demonstrates how to read the soil moisture sensor value and use the mositure value to control the on-board LED
9-
* flash rate. The drier the soil, the faster the LED flashes.
10-
*
8+
* This example demonstrates how to read the soil moisture sensor value and use the moisture value to control the
9+
* on-board LED flash rate. The drier the soil, the faster the LED flashes.
10+
*
1111
* Supported Sensor:
1212
* Qwiic Soil Moisture Sensor https://www.sparkfun.com/sparkfun-qwiic-soil-moisture-sensor.html
13-
*
13+
*
1414
* Hardware Connections:
15-
* - Connect the Qwiic Soil Moisture Sensor to the Qwiic connector of your development board (SparkFun Thing Plus, ReadBoard ...etc.)
16-
* If you don't have a development board with a Qwiic connector, you can purchase one at sparkfun.com
15+
* - Connect the Qwiic Soil Moisture Sensor to the Qwiic connector of your development board (SparkFun Thing Plus,
16+
* RedBoard ...etc.) If you don't have a development board with a Qwiic connector, you can purchase one at sparkfun.com
1717
* - Connect the development board to your computer using a USB cable.
1818
* - Open the Serial Monitor at a baud rate of 115200 to see the sketch output.
19-
*
19+
*
2020
*---------------------------------------------------------------------------------
2121
*/
2222

@@ -58,8 +58,8 @@ SparkFunSoilMoistureSensorI2C mySoilSensor; // Create an instance of the sensor
5858
// Time between loop iterations - Just make it the same as our FAST RATE.
5959
#define LOOP_DELAY FAST_FLASH_RATE
6060

61-
// Time between Soil Moisture readings - 30 seconds
62-
#define SOIL_MOISTURE_READ_RATE 30000
61+
// Time between Soil Moisture readings - 15 seconds
62+
#define SOIL_MOISTURE_READ_RATE 15000
6363

6464
// Define a variable for the last blink time - in ms since boot
6565
uint32_t lastBlinkTime = 0;
@@ -139,7 +139,7 @@ void setup()
139139

140140
// initial last blink time - now!
141141
lastBlinkTime = millis();
142-
// initial last sensor read time - just 0;
142+
// initial last sensor read time - just 0;
143143
lastSensorReadTime = 0;
144144

145145
Serial.println("Reading soil moisture sensor...");
@@ -217,7 +217,7 @@ void checkSensorValue(void)
217217
{
218218
blinkRate = newBlinkRate;
219219
Serial.print("New blink delay: ");
220-
Serial.print(blinkRate/1000);
220+
Serial.print(blinkRate / 1000);
221221
Serial.println(" seconds");
222222
}
223223
// update the last read time
@@ -227,8 +227,8 @@ void checkSensorValue(void)
227227
//----------------------------------------------------------------------------------------
228228
void loop()
229229
{
230-
// check if we need to flash the LED
231-
checkForLEDBlink();
230+
// check if we need to flash the LED
231+
checkForLEDBlink();
232232

233233
// Need to output/get the sensor value?
234234
checkSensorValue();

0 commit comments

Comments
 (0)