TargetManager

Dependents:   TargetManagerManualTest NerfUSTarget

Committer:
dupm2216
Date:
Sun Mar 12 00:33:25 2017 +0000
Revision:
3:70212b0e0939
Parent:
2:08171ac3fea4
Child:
4:166a5b9c6e91
Decouple Bumper from TargetManager

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 3:70212b0e0939 11 #include "NerfusCallbackInterface.hpp"
dupm2216 1:45fbca28eb57 12
dupm2216 1:45fbca28eb57 13 class Bumper
dupm2216 1:45fbca28eb57 14 {
dupm2216 1:45fbca28eb57 15 public:
dupm2216 3:70212b0e0939 16 Bumper(PinName pin, NerfusCallbackInterface& nerfus_callback);
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 3:70212b0e0939 24 NerfusCallbackInterface& nerfus_callback;
dupm2216 2:08171ac3fea4 25 bool is_enabled;
dupm2216 1:45fbca28eb57 26 };
dupm2216 1:45fbca28eb57 27
dupm2216 1:45fbca28eb57 28 #endif