How to tell if an Android device has Open Accessory Mode

前端 未结 5 698
旧时难觅i
旧时难觅i 2021-01-24 11:01

Does anyone know how to check for this? I just bought a Samsung Galaxy Tab 2 (7\" version running Android 4.0.3) with the intention of using it to connect to my Arduino Mega ADK

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-24 11:41

    I just got my Samsung Galaxy Tab 2 with a 7 inch screen. It is running Android 4.0.3 and I can get it to work with the Arduino Mega ADK! I am running the Arduino 0023 interface for compiling the code. The Arduino 1.0 interface broke too many libraries so I switched to the older interface. Comment out the line "init_joystick( 5 );" if you do not have a shield. I could verify that the waveforms for the 3 servos were correct using an oscilloscope.

    If you still can't get it to work try commenting out any code related to the joystick since it's probably hanging on the I2C communications. Otherwise, go to the dfrobot website and order an ADK shield for around $60 so that the Joystick is read properly. That's my next step.

    Update: noticed that the update rates to the tablet were really slow. Fix was to comment out this line if you don't have a shield:

    //touchcount = touch_robot.capSense(5);

    The touch device is attached to the serial lines so I'm assuming that not having one is causing a long delay due to a timeout.

提交回复
热议问题