【问题标题】:Coaxial Switch Using Arduino and Multiplexers使用 Arduino 和多路复用器的同轴开关
【发布时间】:2012-04-16 09:14:27
【问题描述】:

嗨,也许有人可以在这里帮助我,基本上我正在尝试构建一个计算机控制的同轴开关。我正在使用常规的集成电路多路复用器来处理将哪个通道连接到输出。所以基本上我有:

                  (8 X Coaxial Inputs)
                  I I I I I I I I 

微控制器----> |多路复用器 | --------------- 一世 (1 X 同轴输出)

我的想法是让我可以使用计算机来控制我可以观看的 8 个视频源中的哪一个。我认为因为连接是直通的,所以我不必担心衰减,但我尝试使用面包板进行示例设置,我几乎看不到图片。关于如何让它发挥作用的任何想法?

我目前正在使用带有我列出的所有组件的面包板以及一些小规格电缆(以便它们安装在面包板上)

【问题讨论】:

标签: video arduino integrated


【解决方案1】:

软件:

你需要安装腻子:
putty 是一个跨平台的串口客户端。
可用于ssh和串口客户端

硬件:

您可以使用常规继电器进行切换(不要忘记继电器线圈上的二极管)
和你的多路复用器,

将多路复用器数据引脚连接到 arduino 到 3 个数字 IO。
例如mux0 = pin 2, mux1 = pin3 mux3 = pin4

软件:

类似的东西

//assign multipex pins
const int mux0=2;
const int mux1=3;
const int mux2=4;

//global variables
int current=0;

void setup()
{
  Serial.begin(9600);
  displayMenu();
}
void loop()
{
  if(Serial.available()) //check if new byte is comming
  {
    char in = Serial.read();//read the byte
    if(in >= '0' && in <= '7')//check if it is a usable number
    {
      current = in - 48; // ASCII 0= 48 ASCII 7=55 so it is linear moved whith 48
      //write output; by reading individual bits of in and write them to te outputs
      digitalWrite(mux0,bool(current & 0b00000001));
      digitalWrite(mux1,bool(current & 0b00000010));
      digitalWrite(mux2,bool(current & b00000100));
      //update screen
      Serial.write(8); //removes last char;
      Serial.print(current)
    }
    else
      displayMenu(); //if wrong input then displayMenu
  }
}
void displayMenu()
{
  //clear output 
  for(int i=0;i<=200;i++)
    Serial.write(10); //line feed
  Serial.write(13); //carriage return

  //replace 'input x' by were the camera is placed; 
  Serial.println("0: input 0");
  Serial.println("1: input 1");
  Serial.println("2: input 2");
  Serial.println("3: input 3");
  Serial.println("4: input 4");
  Serial.println("5: input 5");
  Serial.println("6: input 6");
  Serial.println("7: input 7");
  Serial.println();
  Serial.print("current selected: ");
  Serial.print(current);
}

未经测试,但应该可以工作;

手动:

你打开串行终端。 (腻子)
连接到串口 (9600) 波特
输入您要选择的数字

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-12-20
    • 1970-01-01
    • 1970-01-01
    • 2014-03-08
    • 2022-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多