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:
- 22:d9df16225df3
- Parent:
- 20:05e2c4941285
- Child:
- 23:fb47bceb61da
--- a/source/Target.cpp Wed Mar 08 14:06:00 2017 -0500 +++ b/source/Target.cpp Sat Mar 11 12:59:26 2017 -0500 @@ -1,9 +1,13 @@ #include "Target.hpp" -Target::Target(ServomotorInterface& servomotor, LedControllerInterface& led_controller, XbeeTransmitterInterface& xbee_transmitter): +Target::Target(ServomotorInterface& servomotor, + LedControllerInterface& ally_leds, + LedControllerInterface& enemy_leds, + XbeeTransmitterInterface& xbee_transmitter): servomotor(servomotor), - led_controller(led_controller), + ally_leds(ally_leds), + enemy_leds(enemy_leds), xbee_transmitter(xbee_transmitter) { } @@ -24,12 +28,13 @@ void Target::ally_command() { servomotor.set_position_up(); + ally_leds.turn_on(); } void Target::enemy_command() { - led_controller.turn_on(); servomotor.set_position_up(); + enemy_leds.turn_on(); } std::vector<uint8_t> Target::generate_message(uint8_t target_number, Result result, uint16_t time_taken_ms) const