Microbit Magnet

Introduction: Microbit Magnet

About: I like to design something in 3D model, especially with Tinkercad. If you like War Thunder Game, please visit my channel https://www.youtube.com/channel/UCVN62YFLZFSPfleSMSLtOlg Visit my Twitter, Pinterest, Yo…

In the magnet challenge, I made a challenge using Micro:bit that behaved differently when a magnet is near the Micro:bit. The Micro:bit showed different images when I press the buttons in the Micro:bit.

Supplies

For this activity, I used supplies as following:

Micro:bit Battery holder + 2x AAA Batteries

1x Magnet

1x USB Cable (To upload the code)

Also, I used Microsoft Makecode Software. Here is the link: https://makecode.microbit.org/#

Step 1: Program Using Makecode Software

First, I opened the Makecode software. This is the page when

I created new project. Do not forget to rename the project.

There are two choices for coding in Makecode, which are blocks and JavaScript. I chose block because it is easier to use.

Step 2: Program the Micro:bit

Here was my code. You could change the image as you desire.

I downloaded the code by clicking the download button and I connected the Micro:bit to the computer by plugging the USB Cable to the computer. Then, I copied the file that I downloaded previously into the Micro:bit.

Step 3: Test the Code

To test the code, I unplugged the USB cable from the computer.

For Micro:bit to standalone, I plugged in battery holder with the battery inside it.

Usually, the Micro:bit needs compass calibration. Tilt the Micro:bit to fill the screen. After that, test the code. When I pressed button "A" (the left button), and the magnet was far, it showed a cow image. While I pressed button "A" (the left button), and the magnet was near, it showed a giraffe image.

When I pressed button "B" (the right button), and the magnet was far, it showed a duck image. While I pressed button "B" (the right button), and the magnet was near, it showed a target image.

That is my entire project for magnet challenge. I hope you like it. Thank you very much for reading my instruction and do not forget, "Please vote for me".

Many thanks to BBC Micro:bit and Makecode.

For more project idea, visit DIY4 Pro.

Magnets Challenge

Participated in the
Magnets Challenge

Be the First to Share

    Recommendations

    • First Time Author Contest

      First Time Author Contest
    • Micro:bit Contest

      Micro:bit Contest
    • Halloween Contest

      Halloween Contest

    12 Comments

    0
    beckyzuzuw
    beckyzuzuw

    1 year ago

    Thanks for sharing

    0
    familylovermommy
    familylovermommy

    1 year ago

    How exciting to see that magnet can make different behavior for microbit. Two thumbs up! :)

    0
    Mulia Wi
    Mulia Wi

    1 year ago

    Awesome job!

    0
    Penolopy Bulnick
    Penolopy Bulnick

    1 year ago

    That's an interesting idea! Thanks for sharing :)