Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

gator:soil Soil Moisture Sensor

Community Discord

The gator:soil, which can be used to read the moisture of soil can be purchased here.

SparkFun gator:soil

~ hint

To use this package, go to https://makecode.microbit.org, click Add package and search for gator-soil. The package is located here

~

Basic usage

//Grabs moisture from the sensor connected to pin P1, powering it using pin P0 to avoid corrosion on the moisture sensing leads.
gatorMoisture.moisture(AnalogPin.P1, gatorMoistureType.adcVal, DigitalPin.P0)

Use ||Get moisture on pin P0 in adcVal using power pin P0|| to read the moisture value either as a value between 0 and 1 or the straight ADC value.

Example: Moisture Sensor

//Read moisture value and write to screen every 60 seconds
basic.forever(function () {
    basic.showNumber(gatorMoisture.moisture(AnalogPin.P1, gatorMoistureType.adcVal, DigitalPin.P0))
    control.waitMicros(60000000)
})

Supported targets

  • for PXT/microbit

License

MIT

gatorSoil=github:sparkfun/pxt-gator-soil

About

The gator:soil is an analog based sensor capable of reading the moisture level of some dirt to tell you how wet it is, and consequentially, when you need to water your plants.

Resources

License

Packages

No packages published