Bumper
Diff: Bumper.cpp
- Revision:
- 0:712cf0eef294
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Bumper.cpp Sat Mar 11 20:27:16 2017 +0000 @@ -0,0 +1,14 @@ +#include "Bumper.hpp" + +Bumper::Bumper(TargetManager& target_manager, const int id, PinName pin) : + interrupt_in(pin), + target_manager(target_manager), + id(id) +{ + interrupt_in.rise(callback(this, &Bumper::bumped)); +} + +void Bumper::bumped() +{ + target_manager.target_hit(id); +}