File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ def runExample():
4949 print ("\n SparkFun Qwiic Soil Moisture Sensor Example 1\n " )
5050 mySoilSensor = qwiic_soil_moisture_sensor .QwiicSoilMoistureSensor ()
5151
52- if mySoilSensor .is_connected == False :
52+ if mySoilSensor .is_connected () == False :
5353 print ("The Qwiic Soil Moisture Sensor device isn't connected to the system. Please check your connection" , \
5454 file = sys .stderr )
5555 return
Original file line number Diff line number Diff line change @@ -49,9 +49,12 @@ def runExample():
4949 print ("\n SparkFun Qwiic Soil Moisture Sensor Example 2 - Change I2C Address\n " )
5050 mySoilSensor = qwiic_soil_moisture_sensor .QwiicSoilMoistureSensor ()
5151
52- status = mySoilSensor .begin ()
53- if status == False :
54- print ("\n Status: " , status )
52+ if mySoilSensor .is_connected () == False :
53+ print ("The Qwiic Soil Moisture Sensor device isn't connected to the system. Please check your connection" , \
54+ file = sys .stderr )
55+ return
56+
57+ mySoilSensor .begin ()
5558
5659 print ("\n Ready!" )
5760 print ("\n Enter a new I2C address for the Qwiic Soil Moisture Sensor to use." )
You can’t perform that action at this time.
0 commit comments