Background: I'm a newbie to Ardunio. Please be patient. I'm an Avionics teacher at George T. Baker Aviation School in Miami, Florida USA. Please visit our web-site at http://www.bakeraviation.edu/ . My students and I are in the process of building a full motion Flight Simulator using Arduinos to capture motion data packets. See video of our Sim at http://alanmunoz.smugmug.com/Other/Thank-You-ISATAT/28097956_8pFXvM#!i=2374199097&k=dBXbrDp
This project is funded by ISTAT ( INTERNATIONAL SOCIETY OF TRANSPORT AIRCRAFT TRADING FOUNDATION), Miami Dade County Public Schools and The Ed-Fund. Most of the major mechanical aspect of the project is done.
We now beginning to start electrical aspects.
At present we are using MS X Sim software and BFF 6DOF Motion Driver V3.0 beta ( http://bffsimulation.com/6DOF-Motion-Software.php)which captures cues from MS-X. It sends out continuous actuator data in serial format (Bin) such as "AB" byte1 byte2 byte3 byte4 byte5 byte6 byte7 (CR), see ( http://bffsimulation.com/Manual-6DOF/Formats.php ).
We are looking to using 7 Arduino Megas in I2c configuration where there will be one master and six slaves, one for each actuator.
Currently we are using one master and one slave (connected to two different Laptops). I'm at work and don't have master and slave sketches with me. The master works like this, it clears the serial buffer and begins to look for the character "A" once found it reads off each character there after which are turned into integer for each actuator. Act1 data is sent across the I2c to slave 1. Slave 1 prints out the data on it's serial monitor. Initially on the slave monitor when first starting out, I can see the proper data values (53), then it begins to show what i call out liars randomly. Such (65) which is the "A" or "B" (66) or even a "CR" (13).
Then I found an example that uses a different technique which allow one to read of bytes using a while loop. I add the I2c (Wire) commands to have the master send to the slave each bytes read. Again initially the data sequence starts out correct and then begins to show out-liars. Last evening I added code to the slave that would filter out known out-liar values. This seemed to work but then I notice -1 would occasionally come in, I filtered that but the slave did not like that, it would run showing captured data then halt.
With all this said and not having the actual sketches used, what would be the best way to capture a continuous stream of byte in sequence?
I will post Master and Slave sketches when I get home.
Your help in this mater is truly appreciated.