03-29-2014 04:06 PM
I don't open .rar files. Please post a .zip file.
03-29-2014 06:07 PM
Mehr,
a couple of points:
1- I think your .rar file has a few sub-vis missing
2-From what I can see!!, you open serial communication inside a loop that has no wait for serial comm and also, I think you would have a better luck with Mega if you use 9600 as the baud rate.
Check your logic within the first loop.
Regards
Barddya
03-30-2014 04:10 AM
new .zip file added
thanks Nathan_B
03-30-2014 04:15 AM
thanks barddya
missing files are just some pdf files and not important for vi.
i have remove loop and iwill try 9600 buad rate
but i get valied data from x & y axis of bmp5883 but unvalied data from z axis and bmp085 and no data from itg 3200 in same loop.
03-30-2014 02:26 PM
The first thing that I will recommend is to look at the examples provided with a sensor's library to see how to use the VIs. Also, the default baudrate of the Arduino Mega 2560 is 9600 so you must use this value for Init.vi.
The ITG3200 VIs, I can't really comment because I've not tried to work with one of those.
I've attache my version of your VI to see how I would do it. However, like I said, I can't guarantee anything about the ITG3200.
03-31-2014 01:54 PM
Thanks nathan_B
itg3200 dont work and i have disable it in my block diagram
now i have new problem except that.
i get data slowly i need real time data.
when i read one sensor from i2c it work real time and fast but when i use more it get slow!
what should i do/?
03-31-2014 02:05 PM
Well, I guess that depends on how slow you are actually talking. Because the Arduino Mega needs to use a baudrate of 9600, it will be slower than an Arduino Uno that can use 115200.
So, first I must ask if you change to the 9600 baudrate in your VI. Did you try each of the different I2C devices individually to see if one of them is causing it to be slow? What happens if you try to read the same sensor twice in the loop (each on going to a different indicator), does it slow down like you are experiencing currently with multiple I2C devices?
03-31-2014 02:10 PM
i use latest code that you send for me nathan in your post.
it has 9600 buad rate.
there is no change from your code.
03-31-2014 04:32 PM
Mehr,
In my previous post, I mentioned that some files are missing and by missing files, I meant ITG VIs. Still even if I had ITG files it Would not have made much of difference since I don' have the hardware.
Nathan's Modification should work better.
But let us look at it from a different point of view
You say two of the three values are correct. Here is what I would do:
1- use nathan's version and and collect several data set
2- analyze the data that is not good. There are 2 important points that one may be looking for
a— data is randomly produced. What I mean here is that you can not find any pattern on the the sets of data you believe to be incorrect. This may indicate issue with the hardware
b) The sets of data exhibit certain pattern ( off by a factor, or the speed by which you move the device and required time to settle. etc) In this case you verification method may require a closer look)
Regards,
Barddya
04-03-2014 09:00 AM
thanks barddya
yes my board & sensors have some problems
i use new sensor mpu6050 with hmc5883
now i get correct data from both of them withouth delay. but i think they need to be calibrate.is it true?