+21622886281
Joystick Micro:bit

Order the Micro:bit board by joystick

The joystick is a small device that allows users to input directional information, such as up, down, left, and right, into the Micro:bit. This allows users to control the Micro:bit’s output, such as moving a cursor on a screen, or controlling the movement of a robot. The joystick can be connected to the Micro:bit board via the edge connector pins, and can be programmed to interact with the Micro:bit’s sensors and other components.

Purpose of this tutorial:

In this tutorial we will see how to display an arrow on micro:bit whose orientation depends on the direction of the joystick controller:

  • When the user directs the joystick controller to the right, the arrow ” →” is displayed on the micro:bit card.
  • When the user points the joystick to the left, the arrow “←” is displayed on the micro:bit card.
  • When the user points the joystick forward, the arrow “↑” is displayed on the micro:bit card.
  • When the user moves the joystick backwards, the arrow “↓” is displayed on the micro:bit card.
  • When the user presses the joystick button, the value 1 is displayed on the micro:bit card.

Composants nécessaires

Micro:bit board

Micro:bit is a small, low-cost microcontroller board that was developed by the Micro:bit Educational Foundation for use in computer education. It is designed to be easy to use and accessible to a wide range of users, including children and beginners. The Micro:bit board measures about 4cm by 5cm and features a 25-pin edge connector, a 5×5 LED matrix, two programmable buttons, an accelerometer, a compass, a Bluetooth Low Energy (BLE) module, and a USB connector.

The Micro:bit is programmed using a variety of programming languages such as Python, JavaScript, and Microsoft Block Editor. It can be used to control a wide range of devices and projects, including robots, drones, lights, and more. The board can be powered by a USB cable or a 3V coin cell battery and can be programmed using a computer or mobile device.

The Micro:bit is widely used in education, providing a hands-on learning experience for students of all ages to learn computer programming, logic, and problem-solving. It’s also used by hobbyist and makers to create fun and interactive projects.

Microbit GPIO board

A Micro:bit GPIO (General Purpose Input/Output) Expansion Board is an accessory that can be used to extend the capabilities of a Micro:bit by providing additional input/output (I/O) pins. These pins can be used to connect sensors and actuators, such as LEDs, buttons, motors, and other electronic components.

The expansion board typically connects to the Micro:bit using a standard edge connector and provides a set of male headers that can be used to connect external components.

Joystisck

A joystick is a type of input device that typically consists of a stick or handle that can be moved in different directions. The movement of the joystick is often converted into electrical signals that can be interpreted by a computer or microcontroller, such as a Micro:bit.

There are several types of joysticks available, each with their own set of features and capabilities. Some common types include:

  • Analog joysticks: These joysticks use potentiometers to measure the position of the stick and convert it into an electrical signal. The signal can be read by a microcontroller, such as a Micro:bit, to determine the direction and amount of movement of the joystick.
  • Digital joysticks: These joysticks use switches to detect the direction of movement of the stick. They can provide only a limited number of directions, unlike analog joystick.
  • Joystick modules: These are ready-made joystick modules that come with a built-in potentiometer or switch and can be easily connected to a Micro:bit or other microcontroller using a breakout board.

Joysticks are commonly used in video game controllers, remote control devices, and other applications where precise control is needed. They can be used in a combination of other sensors to control a robot or other devices.

connecting wires

Connecting wires are used to connect various components in an electronic circuit. They allow for the transfer of electricity, data, or signals between different devices and components.

When connecting wires to an Arduino or other microcontroller, it is important to pay attention to the correct pinout. The pinout refers to the arrangement of pins on the microcontroller and the corresponding function of each pin. The Arduino pinout can be found in the documentation provided by the manufacturer, or in various resources available online.

test plate

A test plate, also known as a test jig, is a device used to test electronic circuits and components. It is a board or plate that has been designed to hold and connect various components and devices in a specific configuration, allowing for the easy testing and measurement of their performance.

A test plate can be used to test various types of electronic circuits and components, such as microcontrollers, sensors, and actuators. It typically includes connectors and sockets for connecting wires, power supply and measurement devices such as multimeters, oscilloscopes, and power supplies.

Mounting:

To perform the assembly we connect:

  • The +5V to 3.3V pin of the micro:bit
  • The GND pin to the GND from the micro:bit
  • VRx to the pin P2 from the micro:bit
  • VRy to the pin P1 from the micro:bit
  • SW to the pin P0 from the micro:bit

There are several mounting methods.

Mounting (1)

Mounting (2)

Makecode program

  • When the user points the joystick joystick forward, Pin P2 of the micro:bit connected to the VRx of the joystick returns the value 3.
  • When the user points the joystick joystick back, Pin P2 of the micro:bit connected to the VRx of the joystick returns the value 1023.
  • When the user points the joystick joystick to the right, Pin P1 of the micro:bit connected to the VRy of the joystick returns the value 3.
  • When the user points the joystick joystick to the left, Pin P1 of the microphone:bit connected to the VRy of the joystick returns the value 1023.
  • When the user presses the joystick joystick, Pin P0 of the micro:bit connected to the joystick SW returns the value 0.



0 commentaire


Leave a comment

Votre adresse e-mail ne sera pas publiée.

Scroll to Top