Skip to content

Repository files navigation

gator:moisture Moisture Sensor

Community Discord

The gator:starter, which includes the gator:moisture and gator:temp can be purchased here. The gator:moisture, included on the gator:starter is an analog moisture sensor that can be alligator clipped to the micro:bit or gator:bit board.

SparkFun gator:moisture

~ hint

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

~

Basic usage

//Sets the value of the light variable to the value read from the gator:light
let light = 0
light = gatorlight.light(AnalogPin.P0, gatorMoistureType.Lux)

Use ||Get light on pin|| to read the light value from a gator:light sensor attached to a given pin in lux or the straight ADC value.

Example: Light Detector

//Read light value and write it to the micro:bit screen as a bar graph.
let light = 0
basic.forever(function () {
    light = gatorlight.light(AnalogPin.P0, gatorMoistureType.Lux)
    led.plotBarGraph(
        light,
        1023
    )
})

Supported targets

  • for PXT/microbit

License

MIT

gatorMoisture=github:yyaaron/pxt-gator-moisture-temp

About

practice repo about pxt-gator-moisture

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages