The gator:environment, capable of reading several qualities about the air can be purchased here. The gator:light, included on the gator:starter is an analog light sensor that can be alligator clipped to the micro:bit or gator:bit board.
To use this package, go to https://makecode.microbit.org, click Add package
and search for gator-light. The package is located here
//Initializes our environmental sensor so we can get data from it.
gatorEnvironment.beginEnvironment()
Use ||Use Initialize gator:Environment sensors||
to initialize the sensors on the gator:Environment board.
//Use getMeasurement to grab data from any of the sensors channels.
gatorEnvironment.getMeasurement(measurementType.degreesC)
Use ||Get degreesC value||
to grab values from the board. Changing what value you want is as easy as selecting it from the drop down menu.
//Read degrees celsius and write it to the micro:bit screen as a number
gatorEnvironment.beginEnvironment()
basic.forever(function () {
serial.writeLine("" + gatorEnvironment.getMeasurement(measurementType.degreesC))
})
- for PXT/microbit
MIT
gatorParticle=github:sparkfun/pxt-gator-particle