https://github.com/androidthings/contrib-drivers/issues/70 我的问题是 :如果您在此处看到: https://github.com/intel-iot-devkit/upm/blob/master/src/smartdrive/smartdrive.hpp尤其是这样: https://github .com/intel-iot-devkit/upm/blob/master/src/smartdrive/smartdrive.cxxSmartDrive::Run_Seconds(int motor_id, int direction, uint8_t speed, uint8_t duration, bool wait_for_completion, int next_action )您将看到writeArray(array, sizeof(array));好.我需要帮助才能在使用writeRegBuffer(int reg, byte[] buffer, int length)和write(byte[] buffer, int length) 的android事物中使用它解决方案在方向A上运行电动机1pio i2c I2C1 0x1B原始写入0x46 128 0x05 0x00 0xD1使电机1沿B方向运行pio i2c I2C1 0x1B原始写入0x46 127 0x05 0x00 0xD1使电动机2沿A方向运行pio i2c I2C1 0x1B原始0x4E 128 0x05 0x00 0xD1使电动机2沿B方向运行pio i2c I2C1 0x1B写原始0x4E 127 0x05 0x00 0xD1 This is my i2c sensor: http://www.mindsensors.com/rpi/76-smartdrive-high-current-motor-controller look in pdf in Documents sessions pleaseBased on this google guide https://developer.android.com/things/sdk/pio/pio-cli.html What I need to put in XX ZZ YY UU to run motors in determined speed, direction, duration, etc...e.g.: pio i2c I2C1 0x1B write-reg-buffer 0xXX 0xYY 0xUU 0xZZAs (in this case) I will use writeRegBuffer() on my android things app to run one, two or both motors in determined spped, direction, duration, etc?e.g.: I used (via jcenter) this driver in intel edison/android things DP2, but now I want to create an AT driver to use smartdrive in nx pico and rpi 3, because there would be no more mraa:https://github.com/androidthings/contrib-drivers/issues/70My questions is: If you see here: https://github.com/intel-iot-devkit/upm/blob/master/src/smartdrive/smartdrive.hppand especially in this: https://github.com/intel-iot-devkit/upm/blob/master/src/smartdrive/smartdrive.cxxin function SmartDrive::Run_Seconds(int motor_id, int direction, uint8_t speed, uint8_t duration, bool wait_for_completion, int next_action )you will see writeArray(array, sizeof(array));ok. I need help to use this in android things using writeRegBuffer(int reg, byte[] buffer, int length) and write(byte[] buffer, int length) 解决方案 run motor 1 in direction Apio i2c I2C1 0x1B write-raw 0x46 128 0x05 0x00 0xD1run motor 1 in direction Bpio i2c I2C1 0x1B write-raw 0x46 127 0x05 0x00 0xD1run motor 2 in direction Apio i2c I2C1 0x1B write-raw 0x4E 128 0x05 0x00 0xD1run motor 2 in direction Bpio i2c I2C1 0x1B write-raw 0x4E 127 0x05 0x00 0xD1 这篇关于将i2c smartdrive传感器与Pio Cli命令一起使用以运行电动机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-12 17:57