├── Thumbs.db ├── Ardublock.JPG ├── Sample_USB_Communication_57600.apk ├── Sample_USB_Communication_Demo.aia ├── Sample_USB_Communication_Demo.apk ├── Sample_USB_Communication_115200.apk ├── Sample_USB_Communication_Baudrate.aia ├── Help_Communication Appinventor_Arduino_Demo.pdf ├── Help_Communication Appinventor_Arduino_ FULL.pdf ├── TxRxArduino ├── desktop.ini └── TxRxArduino.ino ├── TxRxArduino_DEMO ├── desktop.ini └── TxRxArduino_Demo.ino ├── e4lbrkvi.fw3.txt ├── README.md └── TXRX_Ardublock.abp /Thumbs.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/S2I71/usb_otg_bridge_app_inventor/HEAD/Thumbs.db -------------------------------------------------------------------------------- /Ardublock.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/S2I71/usb_otg_bridge_app_inventor/HEAD/Ardublock.JPG -------------------------------------------------------------------------------- /Sample_USB_Communication_57600.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/S2I71/usb_otg_bridge_app_inventor/HEAD/Sample_USB_Communication_57600.apk -------------------------------------------------------------------------------- /Sample_USB_Communication_Demo.aia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/S2I71/usb_otg_bridge_app_inventor/HEAD/Sample_USB_Communication_Demo.aia -------------------------------------------------------------------------------- /Sample_USB_Communication_Demo.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/S2I71/usb_otg_bridge_app_inventor/HEAD/Sample_USB_Communication_Demo.apk -------------------------------------------------------------------------------- /Sample_USB_Communication_115200.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/S2I71/usb_otg_bridge_app_inventor/HEAD/Sample_USB_Communication_115200.apk -------------------------------------------------------------------------------- /Sample_USB_Communication_Baudrate.aia: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/S2I71/usb_otg_bridge_app_inventor/HEAD/Sample_USB_Communication_Baudrate.aia -------------------------------------------------------------------------------- /Help_Communication Appinventor_Arduino_Demo.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/S2I71/usb_otg_bridge_app_inventor/HEAD/Help_Communication Appinventor_Arduino_Demo.pdf -------------------------------------------------------------------------------- /Help_Communication Appinventor_Arduino_ FULL.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/S2I71/usb_otg_bridge_app_inventor/HEAD/Help_Communication Appinventor_Arduino_ FULL.pdf -------------------------------------------------------------------------------- /TxRxArduino/desktop.ini: -------------------------------------------------------------------------------- 1 | [.ShellClassInfo] 2 | InfoTip=Ce dossier est partagé en ligne. 3 | IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe 4 | IconIndex=12 5 | -------------------------------------------------------------------------------- /TxRxArduino_DEMO/desktop.ini: -------------------------------------------------------------------------------- 1 | [.ShellClassInfo] 2 | InfoTip=Ce dossier est partagé en ligne. 3 | IconFile=C:\Program Files (x86)\Google\Drive\googledrivesync.exe 4 | IconIndex=12 5 | -------------------------------------------------------------------------------- /e4lbrkvi.fw3.txt: -------------------------------------------------------------------------------- 1 | 2 | # Please enter the commit message for your changes. Lines starting 3 | # with '#' will be ignored, and an empty message aborts the commit. 4 | # On branch master 5 | # Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded. 6 | # (use "git pull" to update your local branch) 7 | # 8 | # Changes to be committed: 9 | # modified: Communication_Appinventor_Arduino.pdf 10 | # 11 | # Changes not staged for commit: 12 | # deleted: fce2gs4n.xzy.txt 13 | # 14 | 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # USB_BRIDGE_ANDROID_OTG 2 | USB_BRIDGE_ANDROID_OTG App Inventor 2 3 | 4 | Full app : https://play.google.com/store/apps/details?id=bp.usbbridge.appinv 5 | Demo app : https://play.google.com/store/apps/details?id=bp.usbbridge.appinvDemo. 6 | 7 | 8 | Create in 10 minutes your application on your android tablet that communicates with your Arduino USB board. 9 | Download the following example: https://github.com/S2I71/usb_otg_bridge_app_inventor/ 10 | 11 | Students, teachers, passionate communication discover the first application to control devices FTDI UART with USB connector (Arduino Uno, Mega, Yun, FTDI XBee ...) directly from the development tool APP INVENTOR 2 . (No need for extra Host Shield or Bluetooth. All you need is a Micro USB OTG to USB Adapter.) 12 | 13 | USB Bridge for App Inventor 2 allows through a USB OTG cable to achieve a seamless interface between a USB device and the development tool APP INVENTOR 2. 14 | 15 | You'll be able to develop your own new applications using the power of app inventor 2 (graphic, sensors, databases ...) and the powers of your devices available (LED RGB, Servo, AX12A, DC Motor...) equipped with a USB UART at 115200 bauds 16 | 17 | Use and recycle your old phone using its internal functions instead of using multiple Arduino shield: touch screen display, MP3 player, SD card reader, SMS sending, GPD, GSM,QR Codes, NFC, bluetooth, wifi, various sensors .. .. for your microcontroller based applications. (Arduino, Teensy, XBee ...) 18 | 19 | If your device is not recognized, please send me the references Vendor ID and Product ID as the following example to the arduino uno: Vendor ID: 0x2341, Product ID: 0x0001 20 | 21 | USB Host mode support on android device and Android 3.1+ are required 22 | 23 | 24 | Example:Control an arduino uno card with otg usb and APP INVENTOR 2 25 | 26 | Send and receive datas from Arduino with Serial.println(), Serial.print() , Serial.read() in 115200 baud rate. 27 | 28 | Version Arduino program with Ardublock 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /TxRxArduino/TxRxArduino.ino: -------------------------------------------------------------------------------- 1 | // Sample Arduino sketch for use with usb-serial-for-android OTG and APP INVENTOR 2 2 | // 09/02/2014 3 | // LED ON (13) if received "ON" 4 | // LED OFF (13) If received "OFF" 5 | // Send a message if received "Read" 6 | 7 | String Input_Appinventor_String = ""; // String to hold incoming App inventor Data 8 | 9 | 10 | const int ledPin = 13; 11 | int Valeur = 0 ; 12 | 13 | void setup() { 14 | Serial.begin(57600); //If you change it --> change it in App Inventor 2 15 | // Pin 13 has an LED connected on most Arduino boards: 16 | pinMode(ledPin, OUTPUT); 17 | Input_Appinventor_String.reserve(200); 18 | delay(2000); 19 | } 20 | 21 | void loop() { 22 | 23 | delay(10); 24 | 25 | } 26 | 27 | void serialEvent() { 28 | while (Serial.available()) { 29 | 30 | // Read incomming Control From App Inventor 31 | char inChar = (char)Serial.read(); 32 | // add it to the Input_Appinventor_String: 33 | Input_Appinventor_String += inChar; 34 | 35 | 36 | if (Contains(Input_Appinventor_String ,"Read")){ // If App Inveor Control is "Read" 37 | Serial.println ("Message from Arduino"); // Send a message to App Invetor get result 38 | 39 | Input_Appinventor_String =""; 40 | } 41 | 42 | 43 | if (Contains(Input_Appinventor_String ,"ON")){ // If App Inveot Control is "ON" 44 | digitalWrite(ledPin, HIGH); // Led 13 On 45 | Input_Appinventor_String ="";} 46 | 47 | if (Contains(Input_Appinventor_String ,"OFF")){ // If App Inveot Control is "OFF" 48 | digitalWrite(ledPin, LOW); // Led 13 Off 49 | Input_Appinventor_String ="";} 50 | 51 | } 52 | 53 | } 54 | 55 | bool Contains( String s, String search) { 56 | int max = s.length() - search.length(); 57 | for (int i=0; i<= max; i++) 58 | { 59 | if (s.substring(i) == search) return true; // or i 60 | } 61 | return false; //or -1 62 | } 63 | 64 | -------------------------------------------------------------------------------- /TxRxArduino_DEMO/TxRxArduino_Demo.ino: -------------------------------------------------------------------------------- 1 | // Sample Arduino sketch for use with usb-serial-for-android OTG and APP INVENTOR 2 2 | // 09/02/2014 3 | // LED ON (13) if received "ON" 4 | // LED OFF (13) If received "OFF" 5 | // Send a message if received "Read" 6 | 7 | String Input_Appinventor_String = ""; // String to hold incoming App inventor Data 8 | 9 | 10 | const int ledPin = 13; 11 | int Valeur = 0 ; 12 | 13 | void setup() { 14 | Serial.begin(115200); //in full version you can change it --> change it in App Inventor 2 15 | // Pin 13 has an LED connected on most Arduino boards: 16 | pinMode(ledPin, OUTPUT); 17 | Input_Appinventor_String.reserve(200); 18 | delay(2000); 19 | } 20 | 21 | void loop() { 22 | 23 | delay(10); 24 | 25 | } 26 | 27 | void serialEvent() { 28 | while (Serial.available()) { 29 | 30 | // Read incomming Control From App Inventor 31 | char inChar = (char)Serial.read(); 32 | // add it to the Input_Appinventor_String: 33 | Input_Appinventor_String += inChar; 34 | 35 | 36 | if (Contains(Input_Appinventor_String ,"Read")){ // If App Inveor Control is "Read" 37 | Serial.println ("Message from Arduino"); // Send a message to App Invetor get result 38 | 39 | Input_Appinventor_String =""; 40 | } 41 | 42 | 43 | if (Contains(Input_Appinventor_String ,"ON")){ // If App Inveot Control is "ON" 44 | digitalWrite(ledPin, HIGH); // Led 13 On 45 | Input_Appinventor_String ="";} 46 | 47 | if (Contains(Input_Appinventor_String ,"OFF")){ // If App Inveot Control is "OFF" 48 | digitalWrite(ledPin, LOW); // Led 13 Off 49 | Input_Appinventor_String ="";} 50 | 51 | } 52 | 53 | } 54 | 55 | bool Contains( String s, String search) { 56 | int max = s.length() - search.length(); 57 | for (int i=0; i<= max; i++) 58 | { 59 | if (s.substring(i) == search) return true; // or i 60 | } 61 | return false; //or -1 62 | } 63 | 64 | -------------------------------------------------------------------------------- /TXRX_Ardublock.abp: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 708 10 | 595 11 | 12 | 13 | Copy this function and Add new Commands to control servo... sound.... 14 | 15 | 529 16 | 702 17 | 18 | 19 | 169 20 | 98 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 819 30 | 603 31 | 32 | 935 33 | 423 34 | 35 | 36 | 37 | 38 | 39 | 40 | 819 41 | 633 42 | 43 | 926 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 962 52 | 669 53 | 54 | 423 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 1236 63 | 696 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 1236 73 | 672 74 | 75 | 76 | Turn LED 13 OFF 77 | 78 | 1315 79 | 661 80 | 81 | 82 | 183 83 | 36 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 965 93 | 636 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 1081 106 | 639 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 975 116 | 639 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 889 126 | 606 127 | 128 | 129 | Test if InputAppinventor contains "ON" 130 | 131 | 1414 132 | 593 133 | 134 | 135 | 231 136 | 52 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 709 147 | 438 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 798 156 | 446 157 | 158 | 934 159 | 416 160 | 161 | 162 | 163 | 164 | 165 | 166 | 798 167 | 476 168 | 169 | 481 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 941 178 | 512 179 | 180 | 416 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 1215 190 | 539 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 1215 200 | 515 201 | 202 | 203 | Turn LED 13 ON 204 | 205 | 1306 206 | 507 207 | 208 | 209 | 173 210 | 37 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 944 220 | 479 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 1060 233 | 482 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 954 243 | 482 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 868 253 | 449 254 | 255 | 256 | Test if InputAppinventor contains "ON" 257 | 258 | 1383 259 | 437 260 | 261 | 262 | 242 263 | 56 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 710 274 | 307 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 813 283 | 315 284 | 285 | 930 286 | 408 287 | 288 | 289 | 290 | 291 | 292 | 293 | 813 294 | 345 295 | 296 | 924 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 956 305 | 381 306 | 307 | 408 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 1026 316 | 384 317 | 318 | 319 | Send Message to Android 320 | 321 | 1356 322 | 378 323 | 324 | 325 | 234 326 | 35 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 959 336 | 348 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 1075 349 | 351 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 969 359 | 351 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 883 369 | 318 370 | 371 | 372 | Test if InputAppinventor contains "Read" 373 | 374 | 1405 375 | 302 376 | 377 | 378 | 224 379 | 52 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 7 390 | 380 391 | 392 | 393 | When a serial event appear, this function read incomming message and can compare it. 394 | You can just change parts Read, ON, OFF or add new parts as you want 395 | 396 | 58 397 | 681 398 | 399 | 400 | 310 401 | 120 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 174 411 | 388 412 | 413 | 393 414 | 394 415 | 416 | 417 | 418 | 419 | 420 | 421 | 174 422 | 418 423 | 424 | 391 425 | 398 426 | 427 | 428 | 429 | 430 | 431 | 432 | 174 433 | 448 434 | 435 | 394 436 | 931 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 174 445 | 478 446 | 447 | 398 448 | 932 449 | 450 | 451 | 452 | 453 | 174 454 | 502 455 | 456 | 931 457 | 933 458 | 459 | 460 | 461 | 462 | 174 463 | 526 464 | 465 | 932 466 | 468 467 | 468 | 469 | 470 | 174 471 | 550 472 | 473 | 933 474 | 457 475 | 476 | 477 | 478 | 479 | 480 | 481 | 174 482 | 580 483 | 484 | 468 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 446 494 | 607 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 446 504 | 583 505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 244 514 | 553 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 244 524 | 451 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 244 534 | 421 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 244 544 | 391 545 | 546 | 547 | 548 | 549 | 550 | 551 | 552 | 7 553 | 30 554 | 555 | 556 | Don't change this part, but you can add own setup informations 557 | 558 | 862 559 | 37 560 | 561 | 562 | 216 563 | 87 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 572 | 573 | 303 574 | 337 575 | 576 | 371 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 495 585 | 340 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 304 594 | 38 595 | 596 | 371 597 | 404 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 304 606 | 92 607 | 608 | 387 609 | 471 610 | 611 | 612 | 613 | 614 | 615 | 616 | 304 617 | 122 618 | 619 | 404 620 | 473 621 | 622 | 623 | 624 | 625 | 626 | 627 | 304 628 | 152 629 | 630 | 471 631 | 475 632 | 633 | 634 | 635 | 636 | 637 | 638 | 304 639 | 182 640 | 641 | 473 642 | 477 643 | 644 | 645 | 646 | 647 | 648 | 649 | 304 650 | 212 651 | 652 | 475 653 | 483 654 | 655 | 656 | 657 | 658 | 659 | 660 | 304 661 | 242 662 | 663 | 477 664 | 872 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 304 673 | 296 674 | 675 | 483 676 | 677 | 678 | 679 | 680 | 681 | 682 | 683 | 496 684 | 299 685 | 686 | 687 | 688 | 689 | 690 | 691 | 692 | 652 693 | 269 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 652 703 | 245 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 500 713 | 215 714 | 715 | 716 | 717 | 718 | 719 | 720 | 721 | 722 | 500 723 | 185 724 | 725 | 726 | 727 | 728 | 729 | 730 | 731 | 732 | 500 733 | 155 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 500 743 | 125 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 556 753 | 95 754 | 755 | 756 | 757 | 758 | 759 | 760 | 761 | 762 | 576 763 | 65 764 | 765 | 766 | 767 | 768 | 769 | 770 | 771 | 772 | 576 773 | 41 774 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | --------------------------------------------------------------------------------