Speed of processing

Hi All

I have created a program that works for what we want to do, BUT it is very slow to respond to changes, i have a pile of IF statements then tell it what to do, when the IF statement result changes the output changes to what i want, however seems to take approx a sec to find new statement and change the outputs as required,

Have i over complicated my program, I did try to only change what i needed but it constantly turned things on and off,

I am to be honest at my limit of knowledge of this so any help would be appreciated, and please be gentleā€¦

Cheers Pedro

FINAL_GEARBOX_CODE_inverted.ino (4.04 KB)

Please post your code, in code tags, so that everyone can see it.

Hiya Pedro, Your code is inefficient and difficult to maintain. As you guessed, it looks like beginner code, but none-the-less, it should run plenty fast. I suspect the slowness comes from the connected devices. Can you flesh out the project a bit more? As much detail as you can will be helpful.

ps, this thread probably belongs in Project Guidance rather than Microcontrollers.