This library provides simple interface for the table football goal counter based on a IR LED or laser diode and phototransistor.
Dependents: goal_counter_project
GoalCounter.h@1:eb4ee5706587, 2019-01-13 (annotated)
- Committer:
- nxf46245
- Date:
- Sun Jan 13 14:23:14 2019 +0000
- Revision:
- 1:eb4ee5706587
- Parent:
- 0:d00bd73d08f8
- Child:
- 3:ce69ad70270a
Fix NonCopyable issue
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nxf46245 | 1:eb4ee5706587 | 1 | #ifndef GOALCOUNTER_H |
nxf46245 | 1:eb4ee5706587 | 2 | #define GOALCOUNTER_H |
nxf46245 | 1:eb4ee5706587 | 3 | |
nxf46245 | 0:d00bd73d08f8 | 4 | #include "mbed.h" |
nxf46245 | 0:d00bd73d08f8 | 5 | |
nxf46245 | 0:d00bd73d08f8 | 6 | class GoalCounter { |
nxf46245 | 0:d00bd73d08f8 | 7 | public: |
nxf46245 | 1:eb4ee5706587 | 8 | GoalCounter(PinName pin, Timer * t); |
nxf46245 | 1:eb4ee5706587 | 9 | void tstart(); |
nxf46245 | 1:eb4ee5706587 | 10 | void tstop(); |
nxf46245 | 0:d00bd73d08f8 | 11 | uint8_t get_score(); |
nxf46245 | 0:d00bd73d08f8 | 12 | float get_balltime(uint8_t score); |
nxf46245 | 0:d00bd73d08f8 | 13 | float get_balltime(); |
nxf46245 | 0:d00bd73d08f8 | 14 | float get_ballspeed(uint8_t score); |
nxf46245 | 0:d00bd73d08f8 | 15 | float get_ballspeed(); |
nxf46245 | 1:eb4ee5706587 | 16 | volatile uint8_t is_goal; |
nxf46245 | 0:d00bd73d08f8 | 17 | |
nxf46245 | 0:d00bd73d08f8 | 18 | private: |
nxf46245 | 1:eb4ee5706587 | 19 | InterruptIn * _interrupt; |
nxf46245 | 1:eb4ee5706587 | 20 | volatile uint8_t _score; |
nxf46245 | 1:eb4ee5706587 | 21 | Timer * _t; |
nxf46245 | 1:eb4ee5706587 | 22 | float _balltimes[11]; |
nxf46245 | 1:eb4ee5706587 | 23 | float _time; |
nxf46245 | 0:d00bd73d08f8 | 24 | |
nxf46245 | 0:d00bd73d08f8 | 25 | }; |
nxf46245 | 0:d00bd73d08f8 | 26 | |
nxf46245 | 1:eb4ee5706587 | 27 | #endif |