Skip to main content

Petal Series Button Module

Product Overview

Used to detect button press actions.

Specifications

ItemIllustration
Interface TypeHY2.0 4-pin Right-angle Header
Product Dimensions35.8 mm (L) × 23.8 mm (W)
Product Weight4.4 g (excluding packaging and accessories)

Dimension Drawing

Hardware Wiring

Connect the Petal Series Button Module to the J1 port on the Petal Base Expansion Board.

Software Programming

Creating a New Project and Adding Extensions

  1. Go to makecode.microbit.org and click New Project.

  2. Enter a project name in the pop-up window and click Create.

  3. Click Extensions in the code drawer.

  4. Type petal in the pop-up interface and click the search icon. When the petal software library appears, select it.

Sample Program

Program Link: https://makecode.microbit.org/_YohMzRg2y0p7

You can also download the program directly via the embedded webpage below.

Downloading the Program

  1. Connect your PC to the micro:bit V2 using a USB cable.

  2. Once the connection is successful, your computer will detect a drive named MICROBIT.

  3. Click the icon in the bottom-left corner and select Connect Device.

  4. Click .

  5. Click .

  6. In the pop-up window, select BBC micro:bit CMSIS-DAP and then click Connect. Your micro:bit is now successfully connected.

  7. Click Download Program.

Results

When the button is pressed, the LED matrix displays a heart icon. When the button is released, the LED matrix displays a smiley face icon.