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:
- 36:f55ce07292c9
- Parent:
- 24:801271795da0
- Child:
- 40:1f0a5e5f24f6
--- a/source/Target.cpp Thu Mar 30 15:06:01 2017 -0400 +++ b/source/Target.cpp Wed Apr 05 22:24:50 2017 +0000 @@ -1,5 +1,6 @@ #include "Target.hpp" +int coordinator_address[8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; Target::Target(ServomotorInterface& servomotor, LedControllerInterface& ally_leds, @@ -56,11 +57,11 @@ void Target::timeout(const int time_taken_ms) { const std::vector<uint8_t> message = generate_message(target_number, Target::RESULT_MISSED, time_taken_ms); - xbee_transmitter.transmit(message); + xbee_transmitter.transmit(message, coordinator_address); } 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); + xbee_transmitter.transmit(message, coordinator_address); }