Two Micro:bits Talk About the Weather in Spanish

by vprofe0 in Teachers > 9

36 Views, 0 Favorites, 0 Comments

Two Micro:bits Talk About the Weather in Spanish

W.jpg
Weather.jpg

Objective:

Design and build a simple wireless communication system using BBC micro:bits, where one micro:bit sends a weather-related question or command using button presses or gestures, and another micro:bit responds with the appropriate text or temperature reading on its LED display.

Learning Outcomes

Understanding radio communication between micro:bits

Using conditional statements to trigger specific responses

Reading real-world data (temperature) with micro:bit sensors

Mapping user inputs to meaningful actions

Asking how's the weather like in Spanish

Supplies

Materials Required:


2 x BBC micro:bit boards

2 x Micro USB cables

2 x Battery packs (optional, for wireless use)

2 paper people and markers

Computer with MakeCode

How It Works - Micro:bit 1 (Sender)


  1. Button A: Sends number 1 – Asks "¿Qué tiempo hace?" (What's the weather like?)
  2. Button B: Sends number 2 – Says "Hace calor" (It's hot)
  3. Button A+B: Sends number 3 – Asks "¿Cuál es la temperatura?" (What is the temperature?)
  4. Shake gesture: Sends number 4 – Requests the actual temperature from Micro:bit 2


How It Works - Micro:bit 2 (Receiver):

Listens for incoming numbers via radio.

Depending on the received number:

  1. 1: Displays "que tiempo hace"
  2. 2: Displays "Hace calor"
  3. 3: Displays "Cual es la temperatura"
  4. 4: Displays the actual temperature read from the micro:bit’s onboard sensor


Code

Make code Weather.jpg

CODE

Image of the Block code

hex file attached

Code in Java

radio.onReceivedNumber(function (receivedNumber) {

if (receivedNumber == 1) {

basic.showString("que tiempo hace")

} else if (receivedNumber == 2) {

basic.showLeds(`

# . # . #

. # # # .

. # # # .

. # # # .

# . # . #

`)

basic.clearScreen()

basic.showString("Hace calor")

} else if (receivedNumber == 3) {

basic.showString("Cual es la temperatura")

} else if (receivedNumber == 4) {

basic.showString("" + (input.temperature()))

}

})

input.onButtonPressed(Button.A, function () {

radio.sendNumber(1)

})

input.onButtonPressed(Button.AB, function () {

radio.sendNumber(3)

})

input.onButtonPressed(Button.B, function () {

radio.sendNumber(2)

})

input.onGesture(Gesture.Shake, function () {

radio.sendNumber(4)

})

radio.setGroup(5)



Project in Action

Microbits weather

Video

Personal Reflection

A personal reflection of this project.