Lights turn on when shooter is on.
Change-Id: I434dc4a3eecd2fc3b96e954831cedaba8d8ee4e4
diff --git a/y2016/wpilib/wpilib_interface.cc b/y2016/wpilib/wpilib_interface.cc
index 6d16323..b1c52a4 100644
--- a/y2016/wpilib/wpilib_interface.cc
+++ b/y2016/wpilib/wpilib_interface.cc
@@ -408,6 +408,11 @@
shooter_pusher_ = ::std::move(s);
}
+ void set_lights(
+ ::std::unique_ptr<::frc971::wpilib::BufferedSolenoid> s) {
+ lights_ = ::std::move(s);
+ }
+
void operator()() {
compressor_->Start();
::aos::SetCurrentThreadName("Solenoids");
@@ -439,6 +444,7 @@
LOG_STRUCT(DEBUG, "solenoids", *shooter_);
shooter_clamp_->Set(shooter_->clamp_open);
shooter_pusher_->Set(shooter_->push_to_shooter);
+ lights_->Set(shooter_->lights_on);
}
}
@@ -461,7 +467,7 @@
const ::std::unique_ptr<::frc971::wpilib::BufferedPcm> &pcm_;
::std::unique_ptr<::frc971::wpilib::BufferedSolenoid> drivetrain_left_,
- drivetrain_right_, shooter_clamp_, shooter_pusher_;
+ drivetrain_right_, shooter_clamp_, shooter_pusher_, lights_;
::std::unique_ptr<Compressor> compressor_;
::aos::Queue<::frc971::control_loops::DrivetrainQueue::Output> drivetrain_;
@@ -673,6 +679,7 @@
solenoid_writer.set_drivetrain_right(pcm->MakeSolenoid(0));
solenoid_writer.set_shooter_clamp(pcm->MakeSolenoid(4));
solenoid_writer.set_shooter_pusher(pcm->MakeSolenoid(5));
+ solenoid_writer.set_lights(pcm->MakeSolenoid(6));
solenoid_writer.set_compressor(make_unique<Compressor>());