I need to switch between cameras automatically for DS monitor

I want to press a button and view rear camera instead of front camera

You didn’t say what programming language you were using, but in C++/Java you can use CameraServer to do this (Java below)

MjpegServer switchedCamera = CameraServer.addSwitchedCamera("switched");
UsbCamera camera1 = CameraServer.startAutomaticCapture(0);
UsbCamera camera2 = CameraServer.startAutomaticCapture(1);
...
if (button1) {
  switchedCamera.setSource(camera1);
} else if (button2) {
  switchedCamera.setSource(camera2);
}
3 Likes

Sorry for that, we are using Java I will feedback soon as I can for now I’ll give you a Solution xD

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.