Using multiple axes on MPU6050 to interact with graphics on Processing

Hello

I've been working on this project for a while and it's getting there. I was messing around with a sample piece of code online that read a potentiometer's value and changed the screen color accordingly (from 0 to 255, which is from brown and then blue, then violet).

Now, I'm curious as to how I can do this with an accelerometer/gyroscope.

Let's say I was using solely the X axis. If the value is positive, the screen on processing point an arrow to the right and when it's negative it points left.

What if I had 2 axes? How might I do this in Processing? I was thinking of printing the values via Serial.print() and having them print as follows:

X:
Y:
X:
Y:
...

How might I approach this on Processing? Maybe set x to have an even index or something and if it's modulo is > 0 then it's probably a Y value. And from there it acts accordingly

I wouldn't be surprised if this is vague, but I hope people can help me

Thank you

eezJerome: What if I had 2 axes? How might I do this in Processing?

This isn't a Processing Forum.

If you need help with the code on your Arduino this is the place.

...R

I thought that it'd be ok to ask here...isn't arduino used in processing often?

Sorry!

eezJerome: I thought that it'd be ok to ask here...isn't arduino used in processing often?

They are often used together but the business of writing a Processing program is different from writing an Arduino program.

...R