Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: capsense.h
- Revision:
- 0:4e3ad938564e
- Child:
- 1:40e5ac1119a6
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/capsense.h Tue Jun 28 21:32:51 2022 +0000 @@ -0,0 +1,19 @@ +#pragma once + +#include <mbed.h> + +class CapSense { + public: + CapSense(PinName measure_pin, PinName square_pin); + + bool toggle(); + bool try_measure(); + long read_measurement(); + + private: + DigitalOut square_wave; + DigitalIn cap_sense_measure; + Timer timer; + long last_measurement; + bool measured_this_cycle; +}; \ No newline at end of file