Things used in this project

Hardware components:
☒ IM02
×1
Od01 v0.4.11 front grande
☒ OD01
×1
Md01 v1.0.0 front grande
☒ MD01
×1
Sw01 v1.0.0 front grande
☒ SW01
×1
Pb04 v0.4.1 front grande
☒ PB04
×1
Microbitheart
BBC micro:bit board
×1
AA Batteries(generic)
×2
Xbus
☒ XC10
×1
Software apps and online services:
Cmdscreen2
micro:bit pxt.microbit.org

Code

Micro:bit Humidity Project CodeJavaScript
It is JavaScript code that can be converted into blocks using the makecode.microbit.org webpage. This code allows you to measure the humidity levels with the circuit built in the above tutorial. It can easily be adjusted to your own preferences within the parameters allowed in the micro:bit software
let Humidity = 0
input.onButtonPressed(Button.A, () => {
    if (Humidity < 30) {
        OLED.showString("DRY")
    } else {
        OLED.showString("Moderate")
    }
    if (Humidity > 70) {
        OLED.showString("HUMID!!!")
    } else {
        OLED.showString("Moderate")
    }
})
input.onGesture(Gesture.Shake, () => {
    OLED.showString("Humidity")
    OLED.showNumber(Humidity)
    basic.pause(100)
})
basic.showLeds(`
    # . . . #
    . # . # .
    . . # . .
    . # . # .
    # . . . #
    `)
OLED.init(64, 128)
weatherbit.startWeatherMonitoring()
OLED.showString("Humidity Project")
Humidity = weatherbit.humidity() / 1024

Credits

Instasize 0521202021 zymecd9vfj
Brittany Bull
3 projects • 4 followers
A student exploring the world of coding and IoT from a beginners' perspective
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / LoginAbout BBC micro:bit