Camera Control
This section describes how to run the camera input selection demo script for the PAL–MIPI CSI-2 Bridge Board. The below control script communicates with the board over I2C to dynamically select between the three composite video inputs during live streaming.
Download the Control Script
In Host PC, download the control_pal_mipi.py script file from the download link below and copy it to the Jetson Orin Super Developer Kit:
Download Link: control_pal_mipi.py
Note:
If file is not able to download, go through Full Script section below.
Install Dependencies on Developer Kit
Before running the script, install the required Python libraries on the Developer Kit. Open a terminal and run the following commands:
Update Package List
sudo apt updateInstall pip3
sudo apt install python3-pipDependency 1 — smbus2
pip3 install smbus2 # for i2c communicationRun the Control Script
Once the dependencies are installed, navigate to the directory where the script was copied and execute it using Python3 in terminal
python3 control_pal_mipi.pyThe script communicates with the bridge board over I2C to select between the three composite video inputs. The board supports dynamic input switching via I²C from the host processor, eliminating the need for external switching hardware.
Script Overview
| Function | Description |
|---|---|
| I²C Initialization | Opens I²C bus and connects to the PAL–MIPI bridge board |
Full Script
import smbus2
import time
bus = smbus2.SMBus(9)
I2C_ADDR = 0x48 # Bridge board I2C address
def write_reg(reg, data):
bus.write_byte_data(I2C_ADDR, reg, data)
def select_input(channel):
# channel: 0, 1, or 2 for composite inputs 1, 2, or 3
write_reg(0x00, channel & 0x03)
# Select input 0 (composite channel 1)
select_input(0)
time.sleep(2)
# Select input 1 (composite channel 2)
select_input(1)
time.sleep(2)
# Select input 2 (composite channel 3)
select_input(2)
time.sleep(2)