Quantcast
Channel: Intel Communities: Message List
Viewing all articles
Browse latest Browse all 20046

Re: Grove - I2C Motor Driver does not work with Arduino Expansion Kit

$
0
0

Hi ek,

 

I've tested the code and it seems to work fine. I don't have the shield to test it but I could get the following:

 

I2C signal.JPG

 

That is the signal for this code section:

 

MotorDirectionSet(0b1010);  //0b1010  Rotating in the positive direction

 

If you look the MotorDirectionSet() function you will find the following code:

 

void MotorDirectionSet(unsigned char Direction)  {    //  Adjust the direction of the motors 0b0000 I4 I3 I2 I1  Wire.beginTransmission(I2CMotorDriverAdd); // transmit to device I2CMotorDriverAdd  Wire.write(DirectionSet);        // Direction control header  Wire.write(Direction);              // send direction control information  Wire.write(Nothing);              // need to send this byte as the third byte(no meaning)  Wire.endTransmission();    // stop transmitting
}

 

The first data sent is the direction which is "I2CMotorDriverAdd" and the value of it is 0x0F, then "DirectionSet" is sent; the value of it is 0xAA, the next data sent is "Direction" and its value is 0b1010, and the next data sent is "Nothing" and its value is 0x01. All the data is showed in the screenshot above so I believe the code is working properly.

 

My suggestion would be to check if the direction of the shield is the correct. I hope you find this helpful.

 

Regards,

Diego.


Viewing all articles
Browse latest Browse all 20046

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>