
tombrookYo!
United Kingdom
Asked
— Edited
Hi I'm trying to integrate gyro data to give angle of rotation but am having difficulty getting a high enough sample rate. For instance I've tried timing how long the following line takes to execute using the Diagnostics.Stopwatch
System.Diagnostics.Stopwatch timer = new System.Diagnostics.Stopwatch();
timer.Start();
byte gyro_xvalh = ezb0.I2C.Read(gyro,0x1D); // read from x value register address msb
timer.Stop(); //
MessageBox.Show(string.Format("Elapsed time is: {0}", timer.ElapsedMilliseconds));
Its around 60ms which seems a long time, I'm running and compiling the test script from the c# script in ARC. I could really do with a much faster read time as I want to get as accurate rotation angle as possible.
If anyone knows what the limiting factors are that are resulting in this delay that would be a great help.
Thanks
Tom
Ok I've just got an MMA7455 to check that its not an issue with my i2c device. A read from the x data register using the tutorial example is still taking 50ms so I guess thats as fast as I can expect? Whats the reason for this duration as I know using Arduino's etc you can get much faster readings in order to use gyro data properly?
On an Arduino, you program the microcontroller directly. With EZ-Robot, your computer speaks to the microcontroller over a wireless communication protocol - which introduces a delay.
There is a new firmware coming out with some enhancements to the i2c protocol. It will be quite a bit faster. Also, there is a new bluetooth module that will be on the store shortly with a faster communication speed.
Both of those will help you greatly