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!

BeginnerFull instructions provided12 minutes2,242
Weather Station, With A Shake!

Things used in this project

Hardware components

SW01
XinaBox SW01
×1
OD01
XinaBox OD01
×1
PB04
XinaBox PB04
×1
BBC micro:bit board
BBC micro:bit board
×1
MD01
XinaBox MD01
×1
XC10
XinaBox XC10
×1
AA Battery (generic)
×2
XinaBox IM02
×1

Software apps and online services

pxt.microbit.org
micro:bit pxt.microbit.org

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

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

Comments

Add projectSign up / LoginAbout BBC micro:bit