0
\$\begingroup\$

Hey all I am wondering how to go about switch from camera 1, 2 or 3 using this 3 Channel Video Switcher Module on ebay here. enter image description here

Since there's only V+, V- and signal for the "switch" it looks to take a PWM but I am not quite sure if that's correct or not. If correct then how would I (in code) send that out for each camera to change?

UPDATE

Well I've tried the following code:

int LED_pin = 9; // must be one of 3, 5, 6, 9, 10 or 11 for PWM

void setup() {
  pinMode(LED_pin, OUTPUT); // Initialize pin for output
}

void loop() {
  int dtwait = 1000; // Pause interval, milliseconds
  int V1=20, V2=220, V3=120; // 8-bit output values for PWM duty cycle
  analogWrite(LED_pin, V1);
  delay(dtwait);
  analogWrite(LED_pin, V2);
  delay(dtwait);
  analogWrite(LED_pin, V3);
  delay(dtwait);
}

and just to test it I hooked up 2 green LEDs to digital pin 9 and I can confirm it does light the led's in 3 stages. From bright, medium and then dim-ish.

So I went ahead and powered up the FPV by hooking it up like so: enter image description here

One looks like it says P15V 331QE BZ10 enter image description here

While the other side has one that maybe says STC 15F104E F-4V938.A enter image description here

What could I be doing incorrectly?

\$\endgroup\$
  • \$\begingroup\$ Ask the supplier for a datasheet, and/or find the datasheet for the IC used on the board. (And don't buy things if the supplier doesn't provide adequate documentation.) \$\endgroup\$ – Peter Bennett Nov 18 '14 at 17:02
  • \$\begingroup\$ Updated my OP to show code and my connections. \$\endgroup\$ – StealthRT Dec 7 '14 at 4:28
0
\$\begingroup\$

I used a very similar switch with an Arduino (to generate the PWM signal). Have a look here:

http://www.rcgroups.com/forums/showthread.php?t=1955631

\$\endgroup\$
  • \$\begingroup\$ Can you simplify that posting with just the needed code for switching to either video1, video2 or video3 using the digital pin 3 PWM? Lots of information on that site with a lot more code than i really am in need of. Thanks! \$\endgroup\$ – StealthRT Dec 6 '14 at 20:06
0
\$\begingroup\$

Alright I got it.

Using the #include Servo library I was able to get the following values confirmed that switched the video input:

cam1 = 0-64 and also 153-180
cam2 = 65-123
cam3 = 124-152

The arduino code looks like this:

#include <Servo.h>

Servo myservo;
int pos = 0;

void setup()
{
  myservo.attach(9);
  Serial.begin(9600);
}

void loop()
{
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees 
  {                                  // in steps of 1 degree 
    myservo.write(pos);              // tell servo to go to position in variable 'pos' 
    Serial.println(pos);
    delay(1000);                     // waits 1 minute so i can see the value
  }
}
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.