I have read around on this topic and will be getting hands on shortly and want to make sure I am not reinventing the wheel for the particular approach I want to use and what pitfalls I may encounter. I will be using MIDI triggers feeding their MIDI note and MIDI channel info and data from a Arduino GY-521 MPU-6050 Module 3 axial gyroscope accelerometer stance tilt module. I will be creating a standalone application in Unity to set up the MIDI note and channel as well as sensitivity per trigger and route the MPU-6050 data into one or more of the MIDI controllers for expression based on velocity and tilt etc.
I have a good idea how to program this in the Arduino IDE and C. I want the Unity UI to be able to reprogram the Arduino microcontrollers. So I create the new setup, turn a trigger on or off and adjust the sensitivity of the triggers and alter the MIDI note and channel and which expression controller the accelerometer controls. I then have to send the new program to the Arduino and this is where it gets murky on me and I need clarification. Say I recreate the functions and variables so they are basic copies of the format Arduino uses. I complete the reconfiguring in the Unity app and I then hit an UPLOAD button and the new program is loaded to the Arduino. This program, I assume is sent on the USB port to the Arduino board as serial data.
1.How do I format this data to be read by and reprogram the Arduino? 2. Am I thinking about this in the correct manner? 3.I am also using two BT modules. Can this be done to both left and right modules at once (if I use USB then I can only do either left or right or use two USB out ports on the computer to each separate Arduino BT module talking to the main Arduino boards)