Approved content
The content below is provided by partner.
PXT Extension for the MonkMakes Sensor for micro:bit
For more information on the MonkMakes sensor, see: https://www.monkmakes.com/mb_sensor/
From your Blocks code editor, click Advanced and then Extensions. Next, enter the url:
https://github.com/monkmakes/pxt-mm-sensor.git
into the search field at the top of the screen.
Once the extension is added, you will find a new blocks category called Sensor
First wire up your Sensor to your micro:bit like this.
The sound level block returns a value between 0 and 100 depending on the overall level of sound that the microphone on the sensor is hearing.
This example reads the sound level and if it is above 20, it displays the YES image on the micro:bit’s display for half a second. Try standing a few feet away from the sensor and clapping.
Here’s a link to the Makecode project: https://makecode.microbit.org/_WpsR1T5XpfE2
The temp c block returns the temperature measured by the board’s thermistor in degrees Celcius. There is also a Fahrenheit version of the block.
This example will display the temperature every half second. Try putting your finger on the temperature sensor part of the Sensor board to warm it up.
Here’s a link to the Makecode project: https://makecode.microbit.org/_c5qhvjTaR1u1
The light level block also returns a reading between 0 and 100. This example is very like the thermometer example, displaying the light level every half a second.
Shade the light sensor with your hand and the readings should decrease.
Here’s a link to the Makecode project: https://makecode.microbit.org/_YUfPH3E7qbVc
MIT
sensor=github:monkmakes/pxt-sensor#v0.0.2