Browse Source

Add video format to camera initialization.

master
Ed Walker 5 years ago
parent
commit
026342b4b6
2 changed files with 29 additions and 9 deletions
  1. +9
    -3
      visca_controller/src/visca_controller.cpp
  2. +20
    -6
      visca_controller/src/visca_controller.h

+ 9
- 3
visca_controller/src/visca_controller.cpp View File

@ -318,19 +318,25 @@ void sendViscaPacket(byte *packet, int byteSize) {
void initCameras() {
//Send Address command
Serial.println("Setting addresses...");
sendViscaPacket(address_command, sizeof(address_command));
sendViscaPacket(addressCommand, sizeof(addressCommand));
delay(delayTime); //delay to allow camera time for next command
receiveViscaData();
// Turn off IR control
Serial.println("Disabling IR control...");
sendViscaPacket(ir_off, sizeof(ir_off));
sendViscaPacket(irOff, sizeof(irOff));
delay(delayTime); //delay to allow camera time for next command
receiveViscaData();
// Set camera resolution. Needed for camera w/o DIP switch control of video format.
Serial.println("Setting camera resolution...");
sendViscaPacket(videoFormat, sizeof(videoFormat));
delay(delayTime); //delay to allow camera time for next command
receiveViscaData();
//Send IF_clear command
Serial.println("Sending IF_Clear...");
sendViscaPacket(if_clear, sizeof(if_clear));
sendViscaPacket(ifClear, sizeof(ifClear));
delay(delayTime); //delay to allow camera time for next command
receiveViscaData();
}


+ 20
- 6
visca_controller/src/visca_controller.h View File

@ -105,12 +105,26 @@ byte wbTableManual[6] = { 0x81, 0x01, 0x04, 0x35, 0x06, 0xff };
byte wbTableDirect[9] = { 0x81, 0x01, 0x04, 0x75, 0x00, 0x00, 0x0, 0x00, 0xff }; // 8x 01 04 75 0p 0q 0r 0s ff pqrs = wb table.
// Config
byte address_command[4] = { 0x88, 0x30, 0x01, 0xFF }; // Sets camera address (Needed for Daisy Chaining)
byte if_clear[5] = { 0x88, 0x01, 0x00, 0x01, 0xFF }; // Checks to see if communication line is clear
byte ir_off[6] = { 0x81, 0x01, 0x06, 0x09, 0x03, 0xff }; // Turn off IR control (required for speed control of Pan/Tilt on TelePresence cameras)
byte callLedOn[6] = { 0x81, 0x01, 0x33, 0x01, 0x01, 0xff};
byte callLedOff[6] = { 0x81, 0x01, 0x33, 0x01, 0x00, 0xff};
byte callLedBlink[6] = { 0x81, 0x01, 0x33, 0x01, 0x02, 0xff};
byte addressCommand[4] = {0x88, 0x30, 0x01, 0xFF }; // Sets camera address (Needed for Daisy Chaining)
byte ifClear[5] = {0x88, 0x01, 0x00, 0x01, 0xFF }; // Checks to see if communication line is clear
byte irOff[6] = {0x81, 0x01, 0x06, 0x09, 0x03, 0xff }; // Turn off IR control (required for speed control of Pan/Tilt on TelePresence cameras)
byte callLedOn[6] = { 0x81, 0x01, 0x33, 0x01, 0x01, 0xff };
byte callLedOff[6] = { 0x81, 0x01, 0x33, 0x01, 0x00, 0xff };
byte callLedBlink[6] = { 0x81, 0x01, 0x33, 0x01, 0x02, 0xff };
/*
* Video formats values:
* Value HDMI SDI
* 0x00 1080p25 1080p25
* 0x01 1080p30 1080p30
* 0x02 1080p50 720p50
* 0x03 1080p60 720p60
* 0x04 720p25 720p25
* 0x05 720p30 720p30
* 0x06 720p50 720p50
* 0x07 720p60 720p60
*/
byte format = 0x01;
byte videoFormat[7] = { 0x81, 0x01, 0x35, 0x00, format, 0x00, 0xff }; // 8x 01 35 0p 0q 0r ff p = reserved, q = video mode, r = Used in PrecisionHD 720p camera.
void sendViscaPacket(byte *packet, int byteSize);
void handleHardwareControl();


Loading…
Cancel
Save