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
- Committer:
- nxf46245
- Date:
- 2019-01-13
- Revision:
- 1:eb4ee5706587
- Parent:
- 0:d00bd73d08f8
- Child:
- 3:ce69ad70270a
File content as of revision 1:eb4ee5706587:
#ifndef GOALCOUNTER_H #define GOALCOUNTER_H #include "mbed.h" class GoalCounter { public: GoalCounter(PinName pin, Timer * t); void tstart(); void tstop(); uint8_t get_score(); float get_balltime(uint8_t score); float get_balltime(); float get_ballspeed(uint8_t score); float get_ballspeed(); volatile uint8_t is_goal; private: InterruptIn * _interrupt; volatile uint8_t _score; Timer * _t; float _balltimes[11]; float _time; }; #endif