USBディバイスを接続した時点で、実行するアプリを選択する。
AndroidManifest.xml のinternt-filterの中を修正する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | |
package="com.example.mbedserialtest" | |
android:versionCode="1" | |
android:versionName="1.0" > | |
<uses-sdk | |
android:minSdkVersion="8" | |
android:targetSdkVersion="18" /> | |
<application | |
android:allowBackup="true" | |
android:icon="@drawable/ic_launcher" | |
android:label="@string/app_name" | |
android:theme="@style/AppTheme" > | |
<activity | |
android:name="com.example.mbedserialtest.MainActivity" | |
android:label="@string/app_name" > | |
<intent-filter> | |
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" /> | |
</intent-filter> | |
<meta-data | |
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" | |
android:resource="@xml/device_filter" /> | |
</activity> | |
</application> | |
</manifest> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<!-- 0x0403 / 0x6001: FTDI FT232R UART --> | |
<usb-device vendor-id="1027" product-id="24577" /> | |
<!-- 0x2341 / Arduino --> | |
<usb-device vendor-id="9025" /> | |
<!-- 0x16C0 / 0x0483: Teensyduino --> | |
<usb-device vendor-id="5824" product-id="1155" /> | |
<!-- 0x10C4 / 0xEA60: CP210x UART Bridge --> | |
<usb-device vendor-id="4292" product-id="60000" /> | |
<!-- mbed blue VID:0d28 PID:0204 NXP LPC1768 --> | |
<usb-device vendor-id="3368"/> | |
</resources> |
この時点でインストールしてmbedと接続すると。下の様になる。
シリアル通信するには、
FTDrvier : Android USBシリアルドライバを使うのがよさそうです。
mbed のピンD-,D+を使う場合、vendor-id="7936"
Android USB Serial Monitor Lite では、p31 (D+), p32 (D-) and GNDを使った接続と、
実装されているusb どちらでも使うことができた。
USBSerial_HelloWorld と p31 (D+), p32 (D-) and GND 接続の場合
0 件のコメント:
コメントを投稿