You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -32,29 +32,29 @@ The following outlines the general use of the library in an Arduino Sketch.
32
32
33
33
At the start of your sketch, the library header file is included using the following statement:
34
34
35
-
~~~c++
35
+
~~~cpp
36
36
#include"SparkFun_Soil_Moisture_Sensor.h"
37
37
~~~
38
38
39
39
Before the arduino ```setup()``` function, create a Soil Sensor object in your file with the following declaration:
40
40
41
41
For I2C bus:
42
42
43
-
~~~c++
43
+
~~~cpp
44
44
SparkFunSoilMoistureSensorI2C mySoilSensor; // Create an instance of the sensor class
45
45
~~~
46
46
47
47
For SPI bus:
48
48
49
-
~~~c++
49
+
~~~cpp
50
50
SparkFunSoilMoistureSensorSPI mySoilSensor; // Create an instance of the sensor class
51
51
~~~
52
52
53
53
### Initialization
54
54
55
55
In the Arduino ```setup()``` function, initialize the sensor by calling the begin method. This method is called after the Arduino `Wire` (I2C) library is initialized.
56
56
57
-
~~~c++
57
+
~~~cpp
58
58
if (mySoilSensor.begin() == false)
59
59
{
60
60
Serial.println("Soil Moisture Sensor not detected at default I2C address. Verify the sensor is connected. Stopping.");
0 commit comments