I need to build a "reconfigurable" firmware, but don't know where to start. Some details :
This is a joystick firmware, but I want the user to be able to reconfigure buttons and leds behaviour (at first) using an external app (or web page). I know about the MMjoy2 firmware, but the source is nowhere to be found. I really don't know how the software is able to reconfigure the firmware "on the fly" :
does the software updates the arduino using variables in eeprom ?
does the software rebuilds / recompiles the firmware each time the configuration changes ?
Something else ?
How would you achieve that ?
I really don't know where to start with this project, although I have quite some experience with arduino.
Saving the user preferences to EEPROM sounds like the way to go
If you use an Arduino board with WiFi and/or Bluetooth capabilities then the software could be configured using a Web page or an app running on a 'phone
Thanks for your answer.
I know how to do it (sort of) using an ESP8266 or ESP32 using a webpage, unfortunately, this arduino won't have any WiFi or Bluetooth capability. It will be a atmega32u4 custom board.
The MMjoy2 software could do it using USB. It seems it writes to the eeprom. This is how it works :
first, put the arduino in bootloader mode
upload the MMjoy2 firmware from the MMjoy GUI
set the buttons / axis configuration inside the MMjoy GUI
save the configuration to the arduino inside the MMjoy GUI (then a popup window explicitly says "writing to eeprom")
I could find examples about reading/writing to the eeprom inside an arduino sketch, but I could not find any guides about how to do it "externaly".
Nothing stops you from writing a serial protocol to write EEPROM locations which in turn configure the program. For example use location zero for the pin number of a button. Pull that number in setup, use that pin as the button pin.