Introduction
The MonkMakes Sensor Board for micro:bit will easily enable you to sense the sound, temperature and light level around you.
In this guide, learn to connect it to the micro:bit with alligator clips, and program it in the MakeCode Editor and MU Editor.
In this guide, learn to connect it to the micro:bit with alligator clips, and program it in the MakeCode Editor and MU Editor.
-
-
-
-
-
-
-
basic.forever(function () { led.plotBarGraph( pins.analogReadPin(AnalogPin.P0) - 511, 512 ) })
-
let reading = 0 let temp_c = 0 basic.forever(function () { reading = pins.analogReadPin(AnalogPin.P1) temp_c = Math.idiv(reading * 75, 1000) - 14 basic.showNumber(temp_c) basic.pause(500) })
-
basic.forever(function () { led.plotBarGraph( pins.analogReadPin(AnalogPin.P2), 100 ) })
-
-
from microbit import * while True: sleep(25) pin0reading = pin0.read_analog() # sound - blue line pin1reading = pin1.read_analog() # temperature - green line pin2reading = pin2.read_analog() # light - orange line print((pin0reading, ((pin1reading-400)*5), pin2reading))
-