Hi, can anybody help me to figure out how to set up and use gyro module?
I use this code:
void ProgramStarted()
{
gyro.Calibrate();
gyro.MeasurementInterval = TimeSpan.FromTicks(TimeSpan.TicksPerMillisecond * 25);
gyro.MeasurementComplete += gyro_MeasurementComplete;
gyro.StartTakingMeasurements();
}
private void gyro_MeasurementComplete(Gyro sender, Gyro.MeasurementCompleteEventArgs e)
{
Debug.Print("x:" + e.X + "y:" + e.Y + "z:" + e.Z);
}
But i dont have any values in debug window.
@ Mike -
Yes of course it is. I corrected the previous post.
@ Alex Bilityuk - What mainboard, socket, and SDK are you using? Have you tried another socket and cable?
@ John -
I am using Raptor, socket 13, 4.3.6 firmware, 2014 R5 SDK, also tried different sockets and cables.
@ Alex Bilityuk - Your code ran fine for me on the latest pre-release. Do you have anything else connected in the designer?
@ John -
Nothing. Only Gyro module and small piece of code i posted. What else options do i have to dig inside my problem?
@ Alex Bilityuk - Do you have a logic analyzer so you can see what is happening over I2C?
@ John -
I rewrote the code. And this way it goes well. it sounds good for for me but any way i don’t understand the problem, why i couldn’t load the previous code?
gyro.LowPassFilter = Gyro.Bandwidth.Hertz256;
gyro.SampleRateDivider = 39;
gyro.Calibrate();
int interval = 25;
gyro.MeasurementInterval = TimeSpan.FromTicks(TimeSpan.TicksPerMillisecond * interval);
gyro.MeasurementComplete += gyro_MeasurementComplete;
gyro.StartTakingMeasurements();
Also can you help me to understand what do the following properties do:
gyro.LowPassFilter = Gyro.Bandwidth.Hertz256;
gyro.SampleRateDivider = 39;
@ Alex Bilityuk - Both of them work to control the internal data sampling rate. It’s hard to say why the rework fixed the issue without being able to reproduce the issue myself.
@ John -
Ok! Module is working and that is it…