Problem working with MeGyro sensor


#1

Hi,

I am trying to run the example of the MeGyro sensor on Makeblock Orion board.
I use the arduino IDE 1.6.7 and the last version of the Makeblock library from github and the other examples work fine.

I only plugged the Gyro sensor on the board and run the MeGyroTest, but it does not output anything.

I tried to debug it by adding log messages and it stops in “MeGyro::begin()”.
When it execute the first “writeReg(0x6b, 0x00)” it stops at “Wire.endTransmission(true)”.

I also tried the I2CScanTest and it also hangs at the first Wire endTransmission() call.

Is it a problem with the arduino version? or is there something else I could check?

Thanks for your help!
Regards.


#2

Which Makeblock library version are you running at?


#3

I am using the v3.22 from https://github.com/Makeblock-official/Makeblock-Libraries.


#4

So, when you open Serial Monitor in Arduino IDE it yhows nothing?


#5

Yes, In the example it stops at gyro.begin();
It never starts outputing the readings in the console.

From what I understand, it stops at the first Wire.endTransmission(true) call, and hangs there.


#6

Please check if the port, the gyro is connected to, matches the port defined in the sketch.


#7

Hi,
In the sketch, no port is defined: I checked the source and you could define one but it is not used. Apparently the MeGyro library only uses an address on the I2C bus.
I think I tried port 3 and port 4.


#8

Ups, yes indeed, no need to define the port in the script. I tested your setup, using the same library and it worked fine. Thus we can conclude that the sketch and the library work. I assume you checked that you do not receive any warnings or the-like upon compiling the sketch?
You should also check that you included the header file for your board into the example sketch. You may have to do this manually. This is how it should look like if you have the Orion board:

#include "MeOrion.h"
#include <Wire.h>

MeGyro gyro;
void setup()
{
  Serial.begin(115200);
  gyro.begin();
}

Did you try other examples (with other sensors), e.g. the Bluetooth example? Do these work?


#9

The MeGryoTest example starts just like that :

#include "MeOrion.h"
#include <Wire.h>

MeGyro gyro;
void setup()
{
  Serial.begin(115200);
  gyro.begin();
}

I tried other sensor such as UltraSonicSensor and InfraredReceiver and they were working fine but they do not use I2C.
I did yet not try the bluetooth example.

I saw something else in the forums that I did not try: When I ran my test program I always kept the power coming from the USB cable, whereas I read that in some cases
you should switch to the battery power.
Could this explain that the example hangs? (I won’t be able to try it before next week end)

Thanks for your help!


#10

No, this does not explain it. You need to keep USB connected anyways, in order to watch Serial Monitor in Arduino IDE


#11

Hi,

I tried again today and managed to make it work!
In fact the problem was that the buzzer switch was active.

Apparently you cannot use the I2C bus when the buzzer is active on the MeOrion board. There is a reference about this in another thread about MeCompass: http://forum.makeblock.cc/t/problems-with-meorion-and-makeblock-compass/2409/2

So now I have to make something that uses the gyro!

Thanks.


#12

Thank You.

Guess I will have to modify the board to allow me to use the buzzer.
Sorry but that is shit hardware design. If you “feature” a buzzer on your board. it should not require turning it off for other things to work.

Looking at the schematic, I would fire the engineer who made that decision.


#13