NerfUS / Bumper
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Bumper.cpp Source File

Bumper.cpp

00001 #include "Bumper.hpp"
00002 
00003 Bumper::Bumper(TargetManager& target_manager, const int id, PinName pin) :
00004     interrupt_in(pin),
00005     target_manager(target_manager),
00006     id(id)
00007 {        
00008     interrupt_in.rise(callback(this, &Bumper::bumped));
00009 }
00010 
00011 void Bumper::bumped()
00012 {
00013     target_manager.target_hit(id);
00014 }