Go to Post Heck, every human being has the potential to change the world, as long as the world still exists. - [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 04-10-2016, 08:52 AM
GoldenGollem's Avatar
GoldenGollem GoldenGollem is offline
Java Programmer
FRC #2509 (Hutchinson Tigerbots)
Team Role: Programmer
 
Join Date: Dec 2015
Rookie Year: 2015
Location: Minnesota
Posts: 24
GoldenGollem is an unknown quantity at this point
Re: Limit Switch Programming

Here is the blank template that I am using to test the limit switch.
Code:
package org.usfirst.frc.team2509.robot;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.livewindow.LiveWindow;
import edu.wpi.first.wpilibj.DriverStation;

public class Robot extends IterativeRobot {
	Talon motor1 = new Talon(0);
	Joystick stick;
	DigitalInput limitSwitch;
	
    public void robotInit() {
        
    }
   
    public void autonomousInit() {
    	}

    public void autonomousPeriodic() {
    	}

    public void teleopPeriodic() {
        if (stick.getRawButton(1)){
        	motor1.set(0.5);
        	}else{ motor1.set(0.0); }
        if (stick.getRawButton(2)){
        	motor1.set(-0.5);
        	}else{ motor1.set(0.0); }
    }

    public void testPeriodic() {
    
    }
    
}

Last edited by GoldenGollem : 04-10-2016 at 01:01 PM.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 02:29 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi