joe carter
/
nitrocarproject
h_and_c_files/Counter.h@0:960b355eaa84, 2010-08-20 (annotated)
- Committer:
- joe
- Date:
- Fri Aug 20 11:18:40 2010 +0000
- Revision:
- 0:960b355eaa84
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joe | 0:960b355eaa84 | 1 | #ifndef _COUNTER__H_ |
joe | 0:960b355eaa84 | 2 | #define _COUNTER__H_ |
joe | 0:960b355eaa84 | 3 | |
joe | 0:960b355eaa84 | 4 | #include "mbed.h" |
joe | 0:960b355eaa84 | 5 | |
joe | 0:960b355eaa84 | 6 | class Counter { |
joe | 0:960b355eaa84 | 7 | |
joe | 0:960b355eaa84 | 8 | public: |
joe | 0:960b355eaa84 | 9 | Counter(PinName pin); |
joe | 0:960b355eaa84 | 10 | void rising(void); |
joe | 0:960b355eaa84 | 11 | int read(void); |
joe | 0:960b355eaa84 | 12 | void reset(void); |
joe | 0:960b355eaa84 | 13 | |
joe | 0:960b355eaa84 | 14 | private: |
joe | 0:960b355eaa84 | 15 | InterruptIn _interrupt; |
joe | 0:960b355eaa84 | 16 | volatile int _count; |
joe | 0:960b355eaa84 | 17 | |
joe | 0:960b355eaa84 | 18 | }; |
joe | 0:960b355eaa84 | 19 | |
joe | 0:960b355eaa84 | 20 | #endif |