How to get compass module to work with mBot


#21

Ok, I spoke too soon. It did work once. I have a 3 axis accelorometer/gyro and a compass connected. And was getting readings on all axis, and from the compass. So that was good. Then I did something else with the mBot, and came back to this. I did ‘upgrade firmware’ again, and ran the program. Now I was getting a number (Not 0) it was 121.xxxx, but I was getting the exact same value for each axis of the accel / gyro and for the compass. The values did not change as I moved the sensors.

I turned everything off, disconnected everything, and stopped the mBlock program. Then I started mBlock up again, reconnected the mBot, etc. And did 'upgrade firmware again. Now when I run the program I am back to all 0s again. :frowning2:

Do I have to install that driver (and restart) every time?

Here is the program:


#22

Hi tgraphic,

You may try the 3 axis and the me compass one by one again.

  1. Test X-Axis accelorometer/gyro:

    Run above program and rotate the module with this direction:

  2. Test Y-Axis value:

    Run above program and rotate the module with this direction:

  3. Test the me compass:
    Before you test the Me compass, please calibrate it first refer to following steps:

  1. Connect Me Compass to Makeblock main board correctly, power on, and then download any one of the compass library we provide.
  2. Press the key on the module until the blue light of the module start flashing, then let go of the key.
  3. During the flashing of the blue light, spin the module (including the mechanical structure connected with it) along the horizontal plane for over 360° steadily.
  4. After the spinning, press the key on the module to exit the calibration. Now the blue light on the module will be solid on.

Here is a link for more info of Me compass.


#23

Hi tech_support,

I tried again. It does not matter if I read one sensor (axis) at a time, or all at once, I still get 0s for everything.

I tried this:

  • I reinstalled the extra driver that the Mac requires again:

" if your PC is Mac, you need pay attention to two points bellow

  1. Before upgrade firmware, need install a driver for Mac, here is the link to download the driver."
  • Then again I upgraded the firmware in mBlock.

  • Now the sensors give varying values again. So success.

But do I really have to reinstall that driver (and restart my laptop) every time I want to use this? To test this, I did some other things with the mBot, that required uploading software to the mBot, then came back to the sensor program.

  • I upgraded the firmware in mBlock, and ran the sensor program
  • I got a value that was not 0, this time it was 38.xxxxxx, for every sensor, and it didn’t change when I moved the sensors. So it was not working
  • I quit mBlock, turned off the mBot, disconnected it, and started again. This time when I ran the program I got all 0s again. Still not working

For one more verification… that ‘need [to] install a driver for Mac, here is the link to download the driver.’ really is the required missing step, I installed it again - restarted my laptop, then started mBlock, etc. and upgraded the firmware again. And now the sensors work again.

This seems strange. And it is certainly inconvenient. But … I can make it work


#24

Hi tgraphic,

Normally, there is no need to re install driver and upgrade firmware again to use it.
Here I test a me compass and 3 Axis, they have no such issue.
May I know what is the system version on your Mac and which version mBlock do you use. It is suggested to use latest version mBlock 3.4.5.

Besides, do you have any other PC to give a try which may help to determine if the issue is on the sensors or not.


#25

Hi Tec_support,

My mac book pro runs OS X El Capitan version 10.11.6. The mBlock is version is 3.4.5.

I have also tried the sensors using a Windows 7 PC, with mBlock and mBot, and they do work as expected there.

So this issue only occurs with my Mac laptop.


#26

Thanks for the feedback!
Here is a new version mBlock 3.4.6 now, you may check if the same issue on your Mac laptop with mBlock 3.4.6.


#27