Get to know more about microbit

Last week, Prof. Dec introduced another creative technology -- microbit. 

At the first time when I hold it in my hand, I wondered how much fun this tiny thing could bring. However, I was totally obsessed with its magic power when I started exploring it. 

source from https://kidscodejeunesse.org/microbit


Beginner Projects 

I start from the very first challenge, to show heart image.


Then, make a heart beat. 


There are many sensors built in microbit, like temperature, action, movement, sound, bearing, etc. I tried many. Here is one example of the light sensor. 


Intermediate Project

In the intermediate projects, I found an interesting project, which is called electronic pet. When I was a kid, I used to have a tiny machine called tomagotchi, having an electronic pet inside. Therefore, I decided to do this project.
  • They’re small gadgets that you can keep on your keyring. A creature is shown on a simple display. You have to look after it, interacting with it by pressing buttons and playing simple games. If you ignore it and don’t feed or clean it, it will get sad, misbehave or become unwell.
  • The code uses a variable called timer to keep track of how long your pet has been ignored. A forever loop adds 1 to the timer every 1 second (1000 milliseconds).
  • If timer reaches 20, your pet shows a sad face on the LED display and makes a sad sound on the built-in speaker outputs.
  • If it reaches 30, your pet falls asleep.
  • If it gets to 40 your pet plays a mysterious sound and dies. The code uses the 'set built-in speaker off' block to stop any other sounds coming out of the speaker. A 'while true' loop makes sure only the skull icon is shown on the LED display.
  • Your pet will stay alive and happy if you interact with it, however! Stroke the logo to make it happy, or shake it to make it giggle. This resets the timer back to 0.
  • If your pet dies you can bring it back to life by pressing the reset button on the back of your micro:bit.
Here are the description of how it work, quoted from this project's homepage. I followed each step to build up the code blocks as shown below. 

The first block is to initiate the electronic pet. The second one is to start the timer. The interactions are smile image and happy sound. The third block controls different interactions under the condition of different time counts. The last one says you will reset timer every time you shake the microbit.

😁

Comments

Popular posts from this blog

Scratch Mini-project: Simple MP4 & Remix