Now you can download a copy of these docs so you can use them offline! Download now
AnalogIOButton.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/AnalogIOButton.h" 00008 #include "DriverStation.h" 00009 00010 const double AnalogIOButton::kThreshold = 0.5; 00011 00012 AnalogIOButton::AnalogIOButton(int port) : 00013 m_port(port) 00014 { 00015 } 00016 00017 bool AnalogIOButton::Get() 00018 { 00019 return DriverStation::GetInstance()->GetEnhancedIO().GetAnalogIn(m_port) < kThreshold; 00020 }
Generated on Thu Jan 12 2012 22:35:17 for WPILibC++ by
1.7.1