Skip to content

sparkfun/pxt-gator-temp

Repository files navigation

gator:temp Temperature Sensor

Community Discord

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

SparkFun gator:temp

~ hint

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

~

Basic usage

//Sets the value of the temperature variable to the value read from the gator:temp
let temperature = 0
temperature = gatortemp.temp(AnalogPin.P0, GatorTempType.F)

Use ||Get Temperature on Pin|| to read the temperature from a gator:temp sensor attached to a certain pin in Celsius, Fahrenheit or the straight ADC value.

Example:Basic Thermometer

This program will take a temperature reading and display it on the micro:bit's screen.

//Read temperature in Fahrenheit and write it the micro:bit's screen.
basic.forever(function () {
    basic.showNumber(gatortemp.temp(AnalogPin.P0, GatorTempType.F))
})

Supported targets

  • for PXT/microbit

License

MIT

gatortemp=github:sparkfun/pxt-gator-temp