Brittany Bull
Published © MIT

Weather Station, With A Shake!

Create your own shake controlled weather station with the help of this tutorial in under 5 minutes!

EasyFull instructions provided12 minutes406
Weather Station, With A Shake!

Things used in this project

Story

Read more

Code

Motion controlled Micro:bit weather station

JavaScript
This is a code example for the Micro:bit motion controlled weather station using the XChips from Xinabox. This is in the JavaScript format. You can convert this to blocks by copying and pasting it into the { } JavaScript tab in the Micro:bit webpage @ https://makecode.microbit.org/
input.onGesture(Gesture.LogoUp, () => {
    OLED.showString("Temperature")
    basic.showString("T:")
    basic.showNumber(weatherbit.temperature() / 100)
    OLED.showNumber(weatherbit.temperature() / 100)
})
input.onGesture(Gesture.Shake, () => {
    OLED.showString("Humidity")
    basic.showString("H:")
    basic.showNumber(weatherbit.humidity() / 1024)
    OLED.showNumber(weatherbit.humidity() / 1024)
})
basic.showString("Wether Station")
weatherbit.startWeatherMonitoring()
OLED.init(64, 128)

Credits

Brittany Bull

Brittany Bull

4 projects • 5 followers
A student exploring the world of coding and IoT from a beginners' perspective

Comments