Combining MPU6050 library with standardFirmata


would someone please point me in the right direction as I have no experience in reading multiple serial ports. I am trying to make a controller using a MPU6050 accelrometer and one hardware button. I would like to read both serial data to use in a processing program. I am not sure if I could simply combine both librarys in the arduino code to use in processing. I am only able to choose between either to get it working. I would really appreciate your input.

I would like to show my code but It is longer than the character limit. Could you tell me how to deal with multiple serial outputs?

Could you tell me how to deal with multiple serial outputs?

In the context of what you want to do, this question does not make sense.

When you installed the Firmate sketch, you performed a lobotomy on the Arduino. It is no longer capable of independent thought, such as reading from a MPU6050.

Get rid of Firmata. Write your own protocol for exchanging information between the Arduino and Processing.

Yes I was wondering if it was necessary to use the Firmata library for a simple switch. I have no experience writing protocols and am not sure how I would go about integrating it with the accelerometer library, would you please tell me how I should go about it?

how I should go about it?

You are using a protocol to communicate with the forum, whether you realize it or not. A protocol is simply an agreed up means of exchanging information. Things like spaces between words, spelling, punctuation, etc. define how we communicate in English. Different rules (hence a different protocol) for Chinese or Arabic.

So, Processing could send “Set pin thirteen to HIGH, please”, and the Arduino could figure out what this means. On the other hand “<S, 13, 1>” is much simpler to send, receive, parse, and interpret.

Make a list of all the things that Processing needs for the Arduino to do, in English. Then, figure out the simplest, non-ambiguous, means of conveying that request to the Arduino. For instance, S could mean Set or Speed or Sensor or SomethingElseAltogether. That involves ambiguity. Make it mean ONE thing.

Could you please give me an example?

Your explanation focuses on wrong translation, I want to know how to convert words into a protocol. If I want to make a switch, how do I do so using the protocol?