+21622886281
App Inventor Micro:bit

Send a message from the smartphone to Micro:bit

Micro:bit is a small, programmable computer that is designed to be easy to use for beginners. It has a variety of inputs and outputs, including a built-in Bluetooth module, which allows it to communicate wirelessly with other devices such as smartphones and tablets.

It is possible to send a message from a smartphone to a Micro:bit via Bluetooth. Here’s a general outline of the steps you would need to take:

  1. Program the Micro:bit to act as a Bluetooth central, so that it can discover and connect to other Bluetooth devices such as smartphones.
  2. Create a smartphone app that can act as a Bluetooth peripheral, and can send messages to the Micro:bit.
  3. Once the Micro:bit has discovered and connected to the smartphone, the user can use the smartphone app to send a message to the Micro:bit.

On the smartphone side, you can use the Bluetooth libraries provided by the platform to send the message to the Micro:bit. You should also consider the different platforms and their API’s on how to send data via Bluetooth.

Purpose of this tutorial:

In this tutorial we will see how to send a message from the smarthpone to the Micro: bit card via Bluetooth.

we will create two programs: a mobile application with App Inventor for the smartphone and a makecode program for the Micro:bit card.

Necessary components

Micro:bit

The micro:bit is a small, low-cost computer designed for educational use, particularly in the fields of computer science and engineering. It is about the size of a credit card and can be programmed using a variety of languages, including Python, JavaScript, and Microsoft Block Editor. The device features a small LED matrix display, two buttons, a built-in accelerometer, and a radio module for wireless communication. The micro:bit is intended to be used as a tool for teaching children how to code and how to create their own digital devices and projects.

Makecode program

Here is the makecode program which allows you to connect the Micro:bit card to the smartphone and to receive messages by bluetooth.

We display in the Micro:bit card:

  • the letter ‘c’ if the Micro:bit card is connected to the smartphone and the letter ‘d’ otherwise.

  • the message received from the smartphone

Creation of the application with App Inventor:

We will create a mobile application named ‘send_microbit’ with App Inventor which allows you to send a message from the smartphone to the Micro:bit card.

We propose to create the design of the application, with the following visual:

Programmation avec App Inventor

Pour programmer l’application, App Inventor nous propose d’utiliser L’espace Blocs qui permet de créer un programme sous forme de schéma bloc. Très simple d’utilisation mais nécessitant un peu de logique de programmation.

Voici le programme de l’application réalisée dans l’espace Blocs de l’App Inventor:

Remark:

After installing the mobile application on your Smartphone, follow these steps to connect to the Micro:bit card:

  1. Click on the ‘scan‘ button
  2. After finding the Micro:bit card, Click on the ‘Stop Scan’ button
  3. Tap the name of the Micro:bit card
  4. Finally click on the ‘connect’ button

Download project Download application




0 commentaire


Leave a comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Scroll to Top