How to make this run faster/more responsive?

Rethink your basic framework.

Your loop() function's primary job is to just watch the user (buttons & data reading). When there is a change, jump to your handler function for that change, deal with it then exit.

Once exited, you automatically show up in loop() again watching Mr user.

You will have different handler functions for each thing the user could do. Change buttonA? handle buttonA, Change buttonB? handle buttonB. Analog valueA changed? handle AnalogA (maybe update that value on screen?).

What your stuff looks like its doing is handling everything all the time change or not. Hard to code and wastes massive amounts of time doing pointless activity.

Good luck.

-jim lee

1 Like