Skip to content

Atividade

Envie um sorriso

Iniciante | MakeCode, Python | Botões, Rádio, Tela de LED | 3 Health, Comunicação, Entrada/saída, Ondas de rádio

Passo 1: Projeto

O que é?

Sharing and receiving kindness is a good way to support your well-being and that of your friends. Create a program using radio to send a smile from one micro:bit to another to support a friend.

This project is part of a series created to offer problem-solving and prototyping activities designed to explore technology as a solution to the challenges of the Global Goals for Sustainable Development.

Introdução

Coding guide

O que você aprenderá

  • How radio communication between electronic devices uses protocols to ensure messages are routed correctly
  • How technology and electronic communication can be used for good

Como funciona

  • This program uses the micro:bit's radio feature to share a smile. You can use it in the MakeCode simulator or flash the code on to 2 or more micro:bits.
  • First, it sets the radio group to 2. Groups are like channels, so any micro:bit using the same group will get the smile. You can use any group number you like from 0-255.
  • When you press button A, it sends a radio text message 'smile'. It also clears the screen so you can send another smile.
  • When it receives a radio message, it shows a smile emoji on the LED display.
  • The combination of radio group and the text of the radio message sent make up a protocol: a set of rules for how two devices communicate.

O que você precisa

  • 2 micro:bits (ou simulador MakeCode)
  • Editor MakeCode ou Python
  • bateria (opcional)

Passo 2: É hora de programar

Passo 3: Vamos melhorar

  • Customise the smile emoji to your own happy face.
  • If you're working in pairs in a class, select your own unique radio group numbers for each pair of students so you can send messages to your partner but not anyone else.
  • You could also do this by keeping the same radio group, but modifying the code so the text message sent is unique to your pair. Modify the code so it only shows a smile if the correct message is received.
  • How might you send a different emoji if you press button B?