Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Sample Code for USB Host with Teensy 3.2?

  1. #1
    Junior Member
    Join Date
    Jan 2016
    Posts
    19

    Sample Code for USB Host with Teensy 3.2?

    I'm using a Teensy 3.2 with a 4,7uF capacitor and I want to use the Teensy USB Host mode... to connect a Android 4.2 device without USB Host port (only USB).

    I want to communicate over a serial connection (ADB) ... but it doesn't work.

    Can someone give me an example of code?


    On the Android side I've made a Server on port 4567 ... and here is my Arduino Code:

    Code:
      // Initialise the ADB subsystem.  
      ADB::init();
    
      delay(1000);
      
      // Open an ADB stream to the phone's shell. Auto-reconnect
      connection = ADB::addConnection("tcp:4567", true, adbEventHandler);  
    
    
    void loop() {
      
      
      if ((millis() - lastTime) > 1000)
      {
        uint16_t data = 22;
        connection->write(2, (uint8_t*)&data);
        lastTime = millis();
      }
    
      // Poll the ADB subsystem.
      ADB::poll();
    
    }

  2. #2

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •