Skip to content

Aktywność

Audible emotion badge

Początkujący | MakeCode | Dźwięk, Przyciski | Wejście/Wyjście

Co to jest?

Display happy and sad icons and play happy and sad sounds on your BBC micro:bit by pressing buttons A and B. This is a great project to encourage students to talk about their feelings.

Audible emotion badge

Jak to działa

  • When you press button A, the micro:bit shows a happy icon on its LED display and plays a happy sound.
  • When you press button B, the micro:bit shows a sad icon on its LED display and plays a sad sound.
  • Inputs allow us to put data into a computer or device. In this project, the inputs are pressing buttons A or B.
  • A detectable action, like a user pressing a button, is sometimes called an event in computing.
  • An output is the processed information that is sent out from a computer. In this project, the output is the icons shown on the micro:bit's display and the sounds that are played from the micro:bit’s speaker.

Czego potrzebujesz

  • micro:bit V2
  • Edytor MakeCode
  • pakiet baterii

Code your project

Oto bloki, których potrzebujesz, aby stworzyć projekt - teraz je połącz.

Instrukcje krok po kroku

  1. Otwórz projekt, aby znaleźć bloki, których potrzebujesz za pomocą przycisków powyżej.
  2. Znajdź i wybierz blok pokazujący ikonę szczęścia.
  3. Put it inside the on button A pressed block.
  4. Find and select the play giggle until done block.
  5. Put the play giggle until done block inside the on button A pressed block underneath the show icon happy block.
  6. Change the sound giggle to happy in the play giggle until done block.
  7. Find and select the show icon sad block.
  8. Put it inside the on button B pressed block.
  9. Now select the remaining play giggle until done block and put it inside the on button B pressed block underneath the show icon sad block.
  10. Change the sound giggle to sad in the play giggle until done block.
  11. Download the program to your micro:bit, attach a battery pack, and try it out!

Zrób to po swojemu

  • Try out some other sounds in the play giggle until done block. Istnieje 10 do wyboru.
  • Wybierz różne ikony do wyświetlenia taki jak zły, zdezorientowany lub zaskoczony.

Przykład ukończonego projektu

Take a peek at some completed code.