Basic class to interface with a 3-pin capacitive proximity sensor

Committer:
snapo
Date:
Mon Nov 01 12:34:36 2021 +0000
Revision:
0:a9afa14d4795
basic class to interface quickly with a 3 pin capacitive proximity sensor;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
snapo 0:a9afa14d4795 1 #pragma once
snapo 0:a9afa14d4795 2 #include "mbed.h"
snapo 0:a9afa14d4795 3
snapo 0:a9afa14d4795 4 class capacitorSensor {
snapo 0:a9afa14d4795 5
snapo 0:a9afa14d4795 6 AnalogIn capSense_;
snapo 0:a9afa14d4795 7 int capReadings_;
snapo 0:a9afa14d4795 8
snapo 0:a9afa14d4795 9 public:
snapo 0:a9afa14d4795 10 //ensure the PinName included is one of the analog pins else the class will function incorrectly.
snapo 0:a9afa14d4795 11 capacitorSensor (PinName capSense);
snapo 0:a9afa14d4795 12 void capReading();
snapo 0:a9afa14d4795 13
snapo 0:a9afa14d4795 14
snapo 0:a9afa14d4795 15 };