summaryrefslogtreecommitdiff
path: root/src/counter.h
blob: cc3e2f42e8ce0776c08684fd48091337f254147c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#ifndef COUNTER_H
#define COUNTER_H

#include "mbed.h"

class Counter
{
private:
    InterruptIn _interrupt;
    volatile int _count;

public:
    Counter(PinName pin);
    void increment();
    int read();
    void write(int new_count);
};

#endif