2014-11-04 89 views
0

我一直在研究一個項目,我們的Android平板電腦只有1個microUSB端口。無論如何,我可以通過HDMI端口發送SERIAL-USB數據嗎?

enter image description here

因爲我們必須通過serialUSB與外部設備進行通信,它變得有點模糊之後,我們注意到,在離開片供電的總線(主機模式)水渠它`電池,直至死亡。而且,我們仍然必須提供足夠的能量來給平板電腦供電。

經過很多嘗試失敗後,如using a OTG-Y cable,修改Kernel Battery Config和使用USB Hub,我需要發現一種方法來執行通信並保持平板電腦充電。

想過使用HDMI甚至音頻/串行。有什麼解決方案我可以期待解決這個問題嗎?

在這一點上,我正在擺脫想法。

回答

0

你可以使用一個arduino,但不是一個普通的,你需要一個兆,我說這是因爲ardiono兆是唯一的arduino我知道與多個串行UART。 Uno例如與USB接口使用相同的UART共享RX/TX串行引腳。

如果你有一百萬,你可以得到一個便宜的USB轉串口模塊,比如這個:http://www.ebay.com/sch/i.html?_from=R40&_sacat=0&_nkw=arduino+usb+to+serial&_sop=15

現在,您將您的PC變成大型的普通的USB這將權力從PC兆。 然後,將平板電腦連接到串行模塊。

所有剩下要做的就是創建一個簡單的鮑腳本的大型數據從串口(PC-USB)轉移到serial2(平板電腦),反之亦然..

例子:

void setup() { 
    // put your setup code here, to run once: 
    Serial.begin(115200); // PC <--> USB 
    Serial1.begin(115200); // Serial <--> Tablet 
} 

void loop() { 
    // put your main code here, to run repeatedly: 
serialComs(); // Tells loop to execute the serialComs() function 
} 

// Serial Comunication function 
void serialComs() { 
    // read from port 1 (Tablet), send to port 0 (PC): 
    if (Serial1.available()) { 
    int inByte = Serial1.read(); 
    Serial.write(inByte); 
    } 

    // read from port 0 (PC), send to port 1 (Tablet): 
    if (Serial.available()) { 
    int inByte = Serial.read(); 
    Serial1.write(inByte); 
    } 
} 

注意:您可能需要在void setup之前添加#DEFINE條目以定義串行至USB模塊上的哪些引腳。

0

我想你通過HDMI的方式將無法正常工作。而您只有一個選項:

您也可以直接加載電池。你可以打開箱子,爲你的電池供電,而不是電池。這也應該起作用。我認爲這不是別的辦法。你

也可以嘗試OTG樞紐:http://www.miniinthebox.com/de/3-in-1-micro-usb-otg-host-adapter-kabel-hub-fuer-samsung-smartphone-tablet-n9000_p1996674.html?currency=EUR&litb_from=paid_adwords_shopping&litb_from=&adword_mt=&adword_ct=73333307802&adword_kw=&adword_pos=1o1&adword_pl=&adword_net=g&adword_tar=&adw_src_id=4196617767_313342362_22461529362_kwd-140182704282&gclid=CJqW-Na8zMcCFc8aGwodznEIZA

但並不是所有的表允許充電和使用USB在同一時間。

相關問題