nrf-rs / microbit

A Rust crate for BBC micro:bit development
BSD Zero Clause License
276 stars 61 forks source link

How to use the LOGO capacitive touch events? #117

Open felipebalbi opened 1 year ago

felipebalbi commented 1 year ago

Hi,

I've been looking for a way to replicate "touched", "pressed", "released" events from the official micropython for microbit, however I couldn't find a way to enable this "touch mode" on p1_04. I tried using p1_04 as an ADC, but that pin is not ADC-capable. Also attempted using it as an input GPIO assuming that when touching LOGO we would ground the signal, but that also didn't work.

Browsing through microbit's micropython support, they have this "Touch Mode" on p1_04, but even looking at nRF52833 documentation, I cannot find any mention of "touch" or "capacitive" for any pin. How is that working and how would one replicate it with this crate?

gatlinnewhouse commented 1 year ago

I've been working on something similar and asked my professor about it who has working code for using the logo capacitive touch here: https://github.com/pdx-cs-embedded-rust/mb2-touch