microsoft / microsoft/pxt-microbit

Expose touch sensor calibration functions (in an extension?)

Open
#5,653 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

apis extension
Dominant language
TypeScript
Stars
804
Forks
721
Avg merge
2d 9h
Merged PRs (30d)
2

Description

Is your feature request related to a problem? Please describe.

The micro:bit touch pins can be calibrated https://github.com/lancaster-university/codal-core/blob/master/inc/drivers/TouchButton.h#L88 - this is great for when you've connected something (like copper tape) to the edge connector etc.

At the moment we used a fixed calibration for the TouchButton thresholds and while that's simple, it stops working once you connect some things to the edge connector.

Describe the solution you'd like

I'd like to have a way to trigger calibration of the touch sensing functions. I don't know whether it needs to be per-pin or for all pins at once.

It could be an extensions, or a new block. I would lean in favour of making it an extension first.

Describe alternatives you've considered

Alternatives are using the old 'resistive touch' options but this requires two contact points.

Additional context

This is V2 only.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the calibration API in codal-core's inc/drivers/TouchButton.h and determine how V2 touch pins expose calibration. Compare whether an extension or a new block should provide per-pin or all-pin calibration, then verify the chosen interface works with edge-connector additions on V2 hardware.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
embedded-iot
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.