user72368: Over the past few months, I've been working on a wearable computer mouse using an Arduino and a 9-dof sensor. Most of the sketch is complete, and works as expected.
Recently, I started investigating how to enable a non-technical user to adjust the sensitivity of the device. Currently, I do this by changing a couple of variables in the sketch. My goal is to be able to create a basic GUI, with some buttons (perhaps unsurprisingly), to accomplish the same.
Requirements:

ability to adjust sensitivity (couple of variables inside sketch) of arduino device through a GUI
does not slow down sketch (I read that you can use serial, but wouldn't constantly checking for serial slow down the operation of the microcontroller?)
can be saved as an executable (easy to set up for a nonprogrammer)

It's fine for the solution to upload a new sketch to the microcontroller, or change variables in the EEPROM. Whatever you suggest is best. I came across this, and a few other similar topics, but due to my inexperience was unable to judge whether that's the best way forward.
I'm not looking for a complete solution, of course. Rather, I would really appreciate any guidance on what the basic "structure" of the solution should be. Then I can determine which parts I can do myself, and which I'll need to seek help on.
Thank you very much for looking at this.

user42015: Reflashing (and with that recompiling) the sketch for every variable change is very over-the-top.
As you already want to write your own program for the PC I would suggest using Serial. That will be the easiest to implement. This would work like the following:

On the Arduino: You regularly check if there is data in the Serial buffer, read if in that case. You read until a newline character \n, which acts as message delimiter (to distinguish one message from the other). If a full message was received (meaning: you read the newline character) you process the message and write the new values to EEPROM (for saving them permanently).

On the PC application: Let the user determine each value. You open the Arduinos COM port (the user will have to select the correct one) to communicate via Serial. Then you send each value, that you want to write to the Arduino, in a specific format. For example <value_name>:<value>. And don't forget the newline character at the end. Then you can close the COM port and exit the application.


This requires the user to choose the corresponding COM port. With using a custom USB profile (I think a custom HID profile should also be able to receive data) you could eliminate that, but this is a big step in difficulty for you to program.

I read that you can use serial, but wouldn't constantly checking for serial slow down the operation of the microcontroller?

No, not really. The actual receiving of data is done by the USB hardware. As processing load you only have the placing of data in the buffer (happens inside an ISR), which only is done when actual data is received, and the checking if there is data in the buffer. That also needs very short time. It should not interfere with your sampling rate. The 9-DoF sensor is most likely way slower. The actual processing of the data is also only done when you actually send data. Here the longest will be saving the data in EEPROM.
So all in all you have little to no impact on performance.

72368: <p>Over the past few months, I've been working on a wearable computer mouse using an Arduino and a 9-dof sensor. Most of the sketch is complete, and works as expected.</p>
<p>Recently, I started investigating how to enable a non-technical user to adjust the sensitivity of the device. Currently, I do this by changing a couple of variables in the sketch. My goal is to be able to create a basic GUI, with some buttons (perhaps unsurprisingly), to accomplish the same.</p>
<p>Requirements:</p>
<ul>
<li>ability to adjust sensitivity (couple of variables inside sketch) of arduino device through a GUI</li>
<li>does not slow down sketch (I read that you can use serial, but wouldn't constantly checking for serial slow down the operation of the microcontroller?)</li>
<li>can be saved as an executable (easy to set up for a nonprogrammer)</li>
</ul>
<p>It's fine for the solution to upload a new sketch to the microcontroller, or change variables in the EEPROM. Whatever you suggest is best. I came across <a href="https://arduino.stackexchange.com/questions/13335/how-do-i-upload-sketch-and-parameters-through-a-user-interface">this</a>, and a few other similar topics, but due to my inexperience was unable to judge whether that's the best way forward.</p>
<p>I'm not looking for a complete solution, of course. Rather, I would really appreciate any guidance on what the basic &quot;structure&quot; of the solution should be. Then I can determine which parts I can do myself, and which I'll need to seek help on.</p>
<p>Thank you very much for looking at this.</p>
 42015: <p>Reflashing (and with that recompiling) the sketch for every variable change is very over-the-top.</p>
<p>As you already want to write your own program for the PC I would suggest using <code>Serial</code>. That will be the easiest to implement. This would work like the following:</p>
<ul>
<li><p>On the Arduino: You regularly check if there is data in the <code>Serial</code> buffer, read if in that case. You read until a newline character <code>\n</code>, which acts as message delimiter (to distinguish one message from the other). If a full message was received (meaning: you read the newline character) you process the message and write the new values to EEPROM (for saving them permanently).</p>
</li>
<li><p>On the PC application: Let the user determine each value. You open the Arduinos COM port (the user will have to select the correct one) to communicate via Serial. Then you send each value, that you want to write to the Arduino, in a specific format. For example <code>&lt;value_name&gt;:&lt;value&gt;</code>. And don't forget the newline character at the end. Then you can close the COM port and exit the application.</p>
</li>
</ul>
<p>This requires the user to choose the corresponding COM port. With using a custom USB profile (I think a custom HID profile should also be able to receive data) you could eliminate that, but this is a big step in difficulty for you to program.</p>
<blockquote>
<p>I read that you can use serial, but wouldn't constantly checking for serial slow down the operation of the microcontroller?</p>
</blockquote>
<p>No, not really. The actual receiving of data is done by the USB hardware. As processing load you only have the placing of data in the buffer (happens inside an ISR), which only is done when actual data is received, and the checking if there is data in the buffer. That also needs very short time. It should not interfere with your sampling rate. The 9-DoF sensor is most likely way slower. The actual processing of the data is also only done when you actually send data. Here the longest will be saving the data in EEPROM.</p>
<p>So all in all you have little to no impact on performance.</p>
