<commit_before>#include "WPILib.h"
#include "math.h"

/**
 * This is a demo program showing the use of the RobotDrive class.
 * The SampleRobot class is the base of a robot application that will automatically call your
 * Autonomous and OperatorControl methods at the right time as controlled by the switches on
 * the driver station or the field controls.
 *
 * WARNING: While it may look like a good choice to use for your code if you're inexperienced,
 * don't. Unless you know what you are doing, complex code will be much more difficult under
 * this system. Use IterativeRobot or Command-Based instead if you're new.
 */
class Robot: public SampleRobot
{
	RobotDrive myRobot; // robot drive system
	//Joystick leftStick; // joystick 1
	//Joystick rightStick;//joystick 2
	Joystick controller;
	Talon forkLift;
	Solenoid leftHook;
	Solenoid rightHook;
	DigitalInput limitSwitch;
	Timer timer;
	bool forkLiftForward;
	bool forkLiftBackward;
	bool timerSet;
	unsigned int seconds;
	unsigned long microseconds;

	//DoubleSolenoid leftHook;
	//DoubleSolenoid rightHook;
public:
	Robot() :
			myRobot(0, 1),	// these must be initialized in the same order
			controller(0),
			forkLift(2),
			leftHook(0),
			rightHook(1),// as they are declared above.
			limitSwitch(0)
			//leftHook(1,2),
			//rightHook(3,4)
	{
		myRobot.SetExpiration(0.1);
		forkLiftForward=false;
		forkLiftBackward=false;
		timerSet=false;
		seconds=5;
		//microseconds is in microseconds so to get 5 seconds we do 5*(10^6)
		microseconds=seconds*pow(10.0,6.0);
	}

	/**
	 * Drive left & right motors for 2 seconds then stop
	 */
	void Autonomous()
	{
		myRobot.SetSafetyEnabled(false);
		myRobot.Drive(-0.5, 0.0); 	// drive forwards half speed
		Wait(2.0); 				//    for 2 seconds
		myRobot.Drive(0.0, 0.0); 	// stop robot
	}

	/**
	 * Runs the motors with arcade steering.
	 */
	void forwardsPulley(){
		forkLift.Set(0.75);
	}
	void backwardsPulley(){
		forkLift.Set(-0.5);
	}
	void stopPulley(){
		forkLift.Set(0);
	}
	void OperatorControl()
	{
		myRobot.SetSafetyEnabled(true);
		while (IsOperatorControl() && IsEnabled())
		{
			myRobot.ArcadeDrive(controller); // drive with arcade style (use left stick)
			//forkLift.Set(rightStick.GetY());//adjust speed of the forkLift using the right joystick
			if((controller.GetRawAxis(3)>0.1)&&timerSet==false){
				forwardsPulley();
			}
			else if((controller.GetRawAxis(3)<-0.1)&&timerSet==false){
				backwardsPulley();
			}
			else if(timerSet==false){
				stopPulley();<commit_msg>removed unneeded code<commit_after>#include "WPILib.h"
#include "math.h"

/**
 * This is a demo program showing the use of the RobotDrive class.
 * The SampleRobot class is the base of a robot application that will automatically call your
 * Autonomous and OperatorControl methods at the right time as controlled by the switches on
 * the driver station or the field controls.
 *
 * WARNING: While it may look like a good choice to use for your code if you're inexperienced,
 * don't. Unless you know what you are doing, complex code will be much more difficult under
 * this system. Use IterativeRobot or Command-Based instead if you're new.
 */
class Robot: public SampleRobot
{
	RobotDrive myRobot; // robot drive system
	//Joystick leftStick; // joystick 1
	//Joystick rightStick;//joystick 2
	Joystick controller;
	Talon forkLift;
	Solenoid leftHook;
	Solenoid rightHook;
	DigitalInput limitSwitch;
	Timer timer;
	bool forkLiftForward;
	bool forkLiftBackward;
	bool timerSet;
	unsigned int seconds;
	unsigned long microseconds;

	//DoubleSolenoid leftHook;
	//DoubleSolenoid rightHook;
public:
	Robot() :
			myRobot(0, 1),	// these must be initialized in the same order
			controller(0),
			forkLift(2),
			leftHook(0),
			rightHook(1),// as they are declared above.
			limitSwitch(0)
			//leftHook(1,2),
			//rightHook(3,4)
	{
		myRobot.SetExpiration(0.1);
		forkLiftForward=false;
		forkLiftBackward=false;
		timerSet=false;
		seconds=5;
		//microseconds is in microseconds so to get 5 seconds we do 5*(10^6)
		microseconds=seconds*pow(10.0,6.0);
	}

	/**
	 * Drive left & right motors for 2 seconds then stop
	 */
	void Autonomous()
	{
		myRobot.SetSafetyEnabled(false);
		myRobot.Drive(-0.5, 0.0); 	// drive forwards half speed
		Wait(2.0); 				//    for 2 seconds
		myRobot.Drive(0.0, 0.0); 	// stop robot
	}

	/**
	 * Runs the motors with arcade steering.
	 */
	void forwardsPulley(){
		forkLift.Set(0.75);
	}
	void backwardsPulley(){
		forkLift.Set(-0.5);
	}
	void stopPulley(){
		forkLift.Set(0);
	}
	void OperatorControl()
	{
		myRobot.SetSafetyEnabled(true);
		while (IsOperatorControl() && IsEnabled())
		{
			myRobot.ArcadeDrive(controller); // drive with arcade style (use left stick)
			if((controller.GetRawAxis(3)>0.1)&&timerSet==false){
				forwardsPulley();
			}
			else if((controller.GetRawAxis(3)<-0.1)&&timerSet==false){
				backwardsPulley();
			}
			else if(timerSet==false){
				stopPulley();
{'fraction_non_alphanumeric': 0.11503347534996956, 'fraction_numerical': 0.02028809089064719, 'mean_word_length': 3.78176527643065, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3894755', 'n_tokens_mistral': 1906, 'n_tokens_neox': 1675, 'n_words': 498}