Updating Arduino code from stand alone app

Hello,

So I am currently developing a midi controller based on an ATMEGA328P-AUR chip and researching how one might update specific lines of code with a script without actually opening Arduino or having the script. (I mean the script is already loaded, but that the end user wouldn't need to look through code to update it)

Ie build a front end app which updates only specific numbers (ie channel, cc number) within the existing script and then sends that to the chip.

Is this possible, if so what language would it be built in? or better yet can it be delivered through the web?

cheers

Do you remember the "compile" step with your Arduino code?

Paul

auto64:
Ie build a front end app which updates only specific numbers (ie channel, cc number) within the existing script and then sends that to the chip.

You could certainly write your Arduino program so it could receive data from (say) a program running on a PC and, if the data needs to be stored for long term use it could be written to the Arduino's EEPROM memory.

If your Arduino board has a Bluetooth or WiFi connection the options for updating the data are much wider.

Just to be clear, that does not require updating the Arduino program - just updating the data that the program works with.

On the other hand if you actually want to give someone a revised program then you can use a hex-uploader program to upload a hex-file (created by you from your program) to the Arduino. That way the user does not need to understand programming or have access to your code.

...R

ok maybe I wasn’t clear enough…

say I have a button, which has a midi channel and a cc value … and I want to update that WITHOUT using the Arduino IDE… so for the end user who doesn’t want to look at code…

I want to be able to get a front end designed that can update the code on the device /or update the last saved version of the code on the PC then upload that to the device … …

I am thinking something like the Korg editor for the nano kontol…

And for it to be done over USB…

So start app, it loads the last saved/exported version of the script… user changes the midi Chanel/cc data they need. click save and upload… app then writes script to device…

can this be done? if so, how?

or having Arduino run its own web server and have that accessibly over USB?

auto64:
So start app, it loads the last saved/exported version of the script.. user changes the midi Chanel/cc data they need. click save and upload.. app then writes script to device..

can this be done? if so, how?

Yes of course it can be done. However get the idea of the Arduino script (program) out of your head. That is not relevant. All you need to do is send new data values to the Arduino. There is no need to change the program.

Imagine for example that you have a simple program that blinks an LED at 1 second intervals. At the top of the program it could have a line like

ledBlinkDuration = 1000;

Now suppose you want to want to change the blink to 500 millisecs. You just need some code elsewhere in the program (perhaps when you press a button) that has

ledBlinkDuration = 500;

Now suppose that you write a PC program that can collect user inputs and then send data to the Arduino. In place of

ledBlinkDuration = 500;

it could be something like

ledBlinkDuration = valueFromPC;

Of course if you do it like that the new value will be lost when the Arduino is switched off. And to avoid that you would need to store the value in the Arduinos EEPROM memory which is not lost when power is turned off.

I don't know what your preferred PC programming language is but maybe have a look at this Simple Python - Arduino demo which should give you the general idea about the PC-Arduino communication. You should be able to replace the Python code with equivalent functionality in any other PC programming language.

The Python code should work on Windows if you edit it to use the Windows style of COM ports.

...R