Camera Code

I’ve been trying to use the CameraServer class to get the camera to send feed to the SmartDashboard, but I haven’t managed to get it to work. I’m using a Microsoft LifeCam HD-3000 which I know works; I’m programming in Java with the WPILib plugin up to date. Any help on how to use the CameraServer would be appreciated. Thanks!


public void robotInit(){
  CameraServer.getInstance().startAutomaticCapture( 0 );
}

This should also work with C++.

if you ever want to do multiple, try this thread:

try:


//All under robot.java
import edu.wpi.first.wpilibj.CameraServer;

//under robotInit
camera = CameraServer.getInstance().startAutomaticCapture()