Sample Project Basic in Microbit

Sample Project Basic in Microbit

Show Icon

This project will use the show icon feature of Micro:bit to display various icons on the LED screen based on user input or certain conditions. This feature is very useful for creating interactive displays that are easy to understand, such as providing visual feedback, creating simple animations, or displaying device status. For example, you can display a smile icon if the device is in good condition or a heart icon when the user provides certain inputs such as pressing a button.

This project is suitable for beginners who want to understand how Micro:bit can respond to user input and display visual information. With a little creativity, this project can be expanded for various applications, such as simple games, weather indicators, or educational tools for children.

Projects to be created:

Mood Icon Display: Display smiley, sad, or heart face icons based on A, B, or A+B button input.

Block Code:

A button: Display smiley face.
B button: Show sad face.
A+B button: Show heart icon.

Inserting Elements into a Program Block

Button A

please set the program block as shown below

  • enter the Input menu
  • then select On Button A Press, drag and drop it to the Workspace
  • next click Basic, then drag and drop Show Icon and insert it into the On Button A Press Block
  • if so, change the icon that was previously in the form of LOVE to SMILE
  • Example results can see the picture below

Button B

please set the program block as shown below

  • enter the Input menu
  • then select On Button A Press, drag and drop it to the Workspace
  • Change A Button To B
  • next click Basic, then drag and drop Show Icon and insert it into the On Button B Press Block
  • if so, change the icon that was previously in the form of LOVE to SAD
  • Example results can see the picture below

Button A+B

please set the program block as shown below

  • enter the Input menu
  • then select On Button A Press, drag and drop it to the Workspace
  • Change A Button to A+B
  • next click Basic, then drag and drop Show Icon and insert it into the On Button B Press Block
  • Example results can see the picture below

Here is the complete block code form

After the 3 blocks are added, the next step is to test the results, by clicking the Start The Simulator button and see the results. If correct, the result will be

Summary

  • Input: The A, B, and A+B keys are used as user input.
  • Output: Smile, sad, or heart face icons are displayed on the Micro:bit LED screen according to the input.
  • Function: The program provides visual feedback to the user with simple icons.

The project can be expanded, for example by adding sounds using an external buzzer or making the icons switch automatically after a few seconds.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *