The touch sensor acts as a button, which detects when it has been pressed. It connects to the sensor port of the breakout board.

It can be attached to Forward Education’s building blocks.

Touch Sensor

Included Kits

This sensor is included in the following kits:

Breakout Board Connection

A diagram showcasing a circular breakout board with a mounted micro:bit at the center, surrounded by various icons representing its features and functionalities. The icons include a battery for power, a wireless symbol for connectivity, a water droplet for moisture detection, a gear for mechanical functions, and an on/off switch for control. The Forward Education logo is visible on the board, with arrows and lines connecting the icons to specific parts of the hardware, illustrating its interactive and modular design.
Image

Connect this component to any of the four sensor ports on the Forward Education breakout board, or daisy chain it to another Forward Education component featuring the sensor icon.

MakeCode Extension

Each time you use this component, you’ll need to add the extension to your MakeCode project.

MakeCode Extensions Drawer

Create a new MakeCode File, and select the Extensions drawer from the toolbar.

Add one of the extensions below:

Image

Using parts from more than one Forward Education Kit? Add this extension to your project instead!

Search for all-fwd-blocks by Forward Education, and add it to your project.

Image

Search for coding-for-good by Forward Education, and add it to your project.

Forward Education MakeCode extension for the Climate Action Kit

Search for fwd-edu by Forward Education, and add it to your project.

Buttons Blocks

Buttons Drawer Makecode

From the toolbar, select the Buttons drawer, and scroll to the Touch category.

The blocks within this category are used to control the sensor input on the solar sensor.

On Touch Down

Image

An event block, which runs when the touch sensor is pressed. Select the “down” dropdown to select “up” or “hold”

  • Down: Runs when the button is first pressed.
  • Up: Runs when the button is released.
  • Hold: Runs every 100ms that the button is held.

Touch Hold Duration (ms)

Image

A reporter block, which logs most recent length of time that the button has been pressed for, in milliseconds.

Touch is Pressed

Image

A boolean block, which returns true if the button is being pressed.

  • True: Pressed
  • False: Not being pressed

Related Content

Feeling Stuck? Explore the Knowledge Base for common questions and troubleshooting tips.