Ks0155 keyestudio USB Host v1.5 shield: Difference between revisions
Keyestudio (talk | contribs) |
Keyestudio (talk | contribs) |
||
(29 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
==keyestudio USB Host | [[image:ks0155.png|thumb|500px|right|Keyestudio USB Host v1.5 shield]] | ||
<br>[[File: | <br> | ||
==Introduction== | |||
keyestudio USB Host shield V1.5 is an add-on board for Arduino USB Host. Directly plug it to Arduino board and it will allow Arduino to have USB Host function. Arduino with host function can communicate with USB devices, such as USB flash disk, keyboards, mouse, joysticks, digital cameras. <br> | |||
Among these functions, the most attractive one is supporting the connection of android phones to realize Google ADK function. <br> | |||
It enables your phone as a control terminal to control your robot or other devices. Meanwhile, it can display the collected data on your mobile terminal. <br> | |||
<br> | |||
==Specification== | |||
* Supporting the Google Android ADK function | |||
* Compatible with [http://wiki.keyestudio.com/index.php/Ks0001_keyestudio_UNO_R3_BOARD UNO R3 ] and [http://wiki.keyestudio.com/index.php/Ks0002_keyestudio_Mega_2560_R3_Development_Board MEGA 2560 control board]. | |||
* Supporting the Android system, provided with [https://drive.google.com/open?id=14-jybsiV2DvRa3cxdCdfRdHZWf9HoN-7 APP software] ( at most Android 4.0.3 version) | |||
* Comes with a reset button | |||
* Realizing the USB Host function, enable to communicate with other USB devices and support the USB HUB function. | |||
* Onbaord comes with double-sided through-hole pad, welding the electronic elements and setting the prototype circuit. | |||
<br>[[File:KS0155 (3).jpg|500px|frameless|thumb]]<br> | |||
<br> | |||
==Technical Details== | |||
* Dimensions: 58mm x 57mm x 17mm | |||
* Weight: 18g | |||
<br>[[File:KS0155 Detail.png|600px|frameless|thumb]]<br> | |||
<br> | |||
==PINOUT== | |||
<br>[[File:KS0155 pinout.jpg|700px|frameless|thumb]]<br> | |||
<br> | |||
==Test Code== | |||
Below is an example code.<br> | |||
[https://drive.google.com/open?id=1ARXS7q2lhEiykEva24em_GLnkHdzrxl5 Click here] to download the libraries.<br> | |||
[https://drive.google.com/open?id=18tH6hN7nRiHDJhyvDp0uGLGBJ0GqvmDB Click here] to download the code <br> | |||
Or you can directly copy and paste the code below to [http://wiki.keyestudio.com/index.php/How_to_Download_Arduino_IDE Arduino IDE]. | |||
<pre> | |||
#include <Max3421e.h> | |||
#include <Usb.h> | |||
#include <AndroidAccessory.h> | |||
#define LED 9 | |||
AndroidAccessory acc("Google, Inc.", | |||
"DemoKit", | |||
"DemoKit Arduino Board", | |||
"1.0", | |||
"http://www.android.com", | |||
"0000000012345678"); | |||
void setup() | |||
{ | |||
Serial.begin(115200); | |||
Serial.print("\r\nStart"); | |||
acc.powerOn(); | |||
pinMode(LED, OUTPUT); | |||
digitalWrite(LED, 0); | |||
} | |||
void loop() | |||
{ | |||
byte msg[3]; | |||
if (acc.isConnected()) { | |||
Serial.print("Accessory connected. "); | |||
int len = acc.read(msg, sizeof(msg), 1); | |||
Serial.print("Message length: "); | |||
Serial.println(len, DEC); | |||
if (len > 0) { | |||
// assumes only one command per packet | |||
if (msg[0] == 0x2) { | |||
if (msg[1] == 0x0) | |||
analogWrite(LED, msg[2]); | |||
} | |||
} | |||
} | |||
delay(100); | |||
} | |||
</pre> | |||
<br> | |||
<span style="color: red">'''Code to Note:'''</span> <br> | |||
'''1.''' Before compile the code, do remember to add the necessary libraries inside the libraries directory of Arduino IDE.<br> | |||
Download the libraries from below link:<br> | |||
https://drive.google.com/open?id=1ARXS7q2lhEiykEva24em_GLnkHdzrxl5<br> | |||
'''2.''' The test code is only compatible for lower Arduino 1.0 version IDE. | |||
<br> | |||
==Example Use== | |||
Install the [https://drive.google.com/open?id=14-jybsiV2DvRa3cxdCdfRdHZWf9HoN-7 DemoKit APP] on your Android phone( at most Android 4.0.3 version). | |||
<br> [[File:KS0155 APP.png|500px|frameless|thumb]]<br> | |||
<br> | |||
Stack the shield onto UNO R3 board and upload the code, connect an external LED. Then connect the shield to your phone using a micro USB cable. | |||
<br>[[File:KS0155 Result.png|700px|frameless|thumb]]<br> | |||
<br> | |||
Powered on, click the icon of DemoKit to enter the input interface, then click Out to enter the output interface. <br> | |||
When slide the Led1, the display data will be changed in the range of 0-255. The greater the value is, the brighter the external LED is. <br> | |||
<br>[[File:KS0155 APP 1.png|260px|frameless|thumb]] [[File:KS0155 APP 2.png|250px|frameless|thumb]] [[File:KS0155 APP 3.png|250px|frameless|thumb]] | |||
<br> | |||
==Resources == | |||
'''Download the libraries, code and the DemoKit APP:'''<br> | |||
https://fs.keyestudio.com/KS0155 | |||
<br> | |||
==Get One Now == | |||
*[https://www.keyestudio.com/free-shipping-keyestudio-usb-host-v15-shield-compatible-with-google-android-adk-support-uno-mega-for-arduino-p0299.html '''Official Website''' ] | |||
*[https://www.aliexpress.com/store/product/Free-shipping-USB-host-shield-compatible-with-Google-Android-ADK-support-UNO-MEGA-for-arduino/1452162_32222489349.html?spm=2114.12010612.8148356.1.46a76568vpY61y '''Shop on Aliexpress''' ] | |||
*[https://www.ebay.com/itm/132756363665 '''Shop on eBay''' ] | |||
[[Category: Shield]] | |||
Latest revision as of 14:59, 6 January 2021
Introduction
keyestudio USB Host shield V1.5 is an add-on board for Arduino USB Host. Directly plug it to Arduino board and it will allow Arduino to have USB Host function. Arduino with host function can communicate with USB devices, such as USB flash disk, keyboards, mouse, joysticks, digital cameras.
Among these functions, the most attractive one is supporting the connection of android phones to realize Google ADK function.
It enables your phone as a control terminal to control your robot or other devices. Meanwhile, it can display the collected data on your mobile terminal.
Specification
- Supporting the Google Android ADK function
- Compatible with UNO R3 and MEGA 2560 control board.
- Supporting the Android system, provided with APP software ( at most Android 4.0.3 version)
- Comes with a reset button
- Realizing the USB Host function, enable to communicate with other USB devices and support the USB HUB function.
- Onbaord comes with double-sided through-hole pad, welding the electronic elements and setting the prototype circuit.
Technical Details
- Dimensions: 58mm x 57mm x 17mm
- Weight: 18g
PINOUT
Test Code
Below is an example code.
Click here to download the libraries.
Click here to download the code
Or you can directly copy and paste the code below to Arduino IDE.
#include <Max3421e.h> #include <Usb.h> #include <AndroidAccessory.h> #define LED 9 AndroidAccessory acc("Google, Inc.", "DemoKit", "DemoKit Arduino Board", "1.0", "http://www.android.com", "0000000012345678"); void setup() { Serial.begin(115200); Serial.print("\r\nStart"); acc.powerOn(); pinMode(LED, OUTPUT); digitalWrite(LED, 0); } void loop() { byte msg[3]; if (acc.isConnected()) { Serial.print("Accessory connected. "); int len = acc.read(msg, sizeof(msg), 1); Serial.print("Message length: "); Serial.println(len, DEC); if (len > 0) { // assumes only one command per packet if (msg[0] == 0x2) { if (msg[1] == 0x0) analogWrite(LED, msg[2]); } } } delay(100); }
Code to Note:
1. Before compile the code, do remember to add the necessary libraries inside the libraries directory of Arduino IDE.
Download the libraries from below link:
https://drive.google.com/open?id=1ARXS7q2lhEiykEva24em_GLnkHdzrxl5
2. The test code is only compatible for lower Arduino 1.0 version IDE.
Example Use
Install the DemoKit APP on your Android phone( at most Android 4.0.3 version).
Stack the shield onto UNO R3 board and upload the code, connect an external LED. Then connect the shield to your phone using a micro USB cable.
Powered on, click the icon of DemoKit to enter the input interface, then click Out to enter the output interface.
When slide the Led1, the display data will be changed in the range of 0-255. The greater the value is, the brighter the external LED is.
Resources
Download the libraries, code and the DemoKit APP:
https://fs.keyestudio.com/KS0155