begin implement own counter class
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
/**
|
||||||
|
* @file pulseCounter.h
|
||||||
|
* @author Alexander Klein (alex@kleiax.de)
|
||||||
|
* @brief
|
||||||
|
* @version 0.1
|
||||||
|
* @date 2023-02-18
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2023
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <stdint.h.h>
|
||||||
|
#include <Arduino.h>
|
||||||
|
#include <esp32_pcnt.h>
|
||||||
|
|
||||||
|
class PulseCounter {
|
||||||
|
public:
|
||||||
|
PulseCounter(uint8_t pin, uint8_t unit);
|
||||||
|
|
||||||
|
private:
|
||||||
|
uint8_t pin;
|
||||||
|
uint8_t unit;
|
||||||
|
|
||||||
|
int16_t counter = 0;
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user