TargetManager

Dependents:   TargetManagerManualTest NerfUSTarget

Committer:
dupm2216
Date:
Sat Mar 11 23:17:12 2017 +0000
Revision:
2:08171ac3fea4
Parent:
1:45fbca28eb57
Child:
3:70212b0e0939
Create TargeTicker; ; It allows the TargetManager to start and stop a timeout ticker with a period in milliseconds. When the ticker expires, it will call TargetManager's target_missed method

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dupm2216 1:45fbca28eb57 1 #ifndef BUMPER_HPP
dupm2216 1:45fbca28eb57 2 #define BUMPER_HPP
dupm2216 1:45fbca28eb57 3
dupm2216 2:08171ac3fea4 4 //Limit switch connections:
dupm2216 1:45fbca28eb57 5 // C (common): pin to read
dupm2216 1:45fbca28eb57 6 // NO (normally open): VCC
dupm2216 2:08171ac3fea4 7 // NC (normally closed): GND
dupm2216 2:08171ac3fea4 8 //Source: http://www.omron.com.au/service_support/FAQ/FAQ03206/index.asp
dupm2216 1:45fbca28eb57 9
dupm2216 1:45fbca28eb57 10 #include "mbed.h"
dupm2216 1:45fbca28eb57 11 #include "TargetManager.hpp"
dupm2216 1:45fbca28eb57 12
dupm2216 1:45fbca28eb57 13 class Bumper
dupm2216 1:45fbca28eb57 14 {
dupm2216 1:45fbca28eb57 15 public:
dupm2216 2:08171ac3fea4 16 Bumper(PinName pin, TargetManager& target_manager, int id);
dupm2216 2:08171ac3fea4 17 void enable();
dupm2216 2:08171ac3fea4 18 void disable();
dupm2216 1:45fbca28eb57 19
dupm2216 1:45fbca28eb57 20 private:
dupm2216 2:08171ac3fea4 21 void bumped();
dupm2216 2:08171ac3fea4 22
dupm2216 1:45fbca28eb57 23 InterruptIn interrupt_in;
dupm2216 1:45fbca28eb57 24 TargetManager& target_manager;
dupm2216 1:45fbca28eb57 25 const int id;
dupm2216 2:08171ac3fea4 26 bool is_enabled;
dupm2216 1:45fbca28eb57 27 };
dupm2216 1:45fbca28eb57 28
dupm2216 1:45fbca28eb57 29 #endif