NerfUS mobile node that manages a target for the Nerf gun firing range
Dependencies: LedController mbed-rtos mbed NerfUSXbee Servomotor TargetManager
Fork of NerfUS by
Diff: source/Target.cpp
- Revision:
- 24:801271795da0
- Parent:
- 23:fb47bceb61da
- Child:
- 36:f55ce07292c9
--- a/source/Target.cpp Sat Mar 11 13:25:00 2017 -0500 +++ b/source/Target.cpp Sat Mar 11 13:30:23 2017 -0500 @@ -58,3 +58,9 @@ const std::vector<uint8_t> message = generate_message(target_number, Target::RESULT_MISSED, time_taken_ms); xbee_transmitter.transmit(message); } + +void Target::hit(const int time_taken_ms) +{ + const std::vector<uint8_t> message = generate_message(target_number, Target::RESULT_HIT, time_taken_ms); + xbee_transmitter.transmit(message); +}