Now you can download a copy of these docs so you can use them offline! Download now
ReleasedButtonScheduler.cpp
00001 /*----------------------------------------------------------------------------*/ 00002 /* Copyright (c) FIRST 2011. All Rights Reserved. */ 00003 /* Open Source Software - may be modified and shared by FRC teams. The code */ 00004 /* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib. */ 00005 /*----------------------------------------------------------------------------*/ 00006 00007 #include "Buttons/ReleasedButtonScheduler.h" 00008 00009 #include "Buttons/Button.h" 00010 #include "Commands/Command.h" 00011 00012 ReleasedButtonScheduler::ReleasedButtonScheduler(bool last, Button *button, Command *orders) : 00013 ButtonScheduler(last, button, orders) 00014 { 00015 } 00016 00017 void ReleasedButtonScheduler::Execute() 00018 { 00019 if (m_button->Grab()) 00020 { 00021 m_pressedLast = true; 00022 } 00023 else 00024 { 00025 if (m_pressedLast) 00026 { 00027 m_pressedLast = false; 00028 m_command->Start(); 00029 } 00030 } 00031 }
Generated on Thu Jan 12 2012 22:35:23 for WPILibC++ by
1.7.1