Created
January 25, 2017 17:24
-
-
Save jonkiddy/fd9cf92fcd5b3de0659b5a560f79190c to your computer and use it in GitHub Desktop.
Revisions
-
jonkiddy created this gist
Jan 25, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,56 @@ package org.usfirst.frc.team4930.robot; import edu.wpi.first.wpilibj.SampleRobot; import edu.wpi.first.wpilibj.Timer; import edu.wpi.first.wpilibj.smartdashboard.SendableChooser; import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; import edu.wpi.first.wpilibj.CameraServer; import edu.wpi.cscore.UsbCamera; public class Robot extends SampleRobot { CameraServer server; UsbCamera cam1; SendableChooser chooser; public Robot() { server = CameraServer.getInstance(); } public void robotInit() { chooser = new SendableChooser(); // not sure about these next few lines, will need to play with this a bit // aslo, smartdashboard will need a camera element added to its display cam1 = server.startAutomaticCapture(); // addtional cameras will nbe needed at some point... // server.addCamera(cam1); // server.startAutomaticCapture(cam1); cam1.setResolution(320, 240); } public void autonomous() { //nothing } public void operatorControl() { double randomInfo = 1.0; while (isOperatorControl() && isEnabled()) { // need to put something on dashbaord to have something show up under Java dashbaord SmartDashboard.putNumber("here is a number...", randomInfo); // wait for a motor update time Timer.delay(0.005); } } public void test() { //nothing } }