New to code writing and looking for help to alter another code. I would like to control the servo on 1 pin, then have an led light on a 2nd pin with the button push on. With the button push off I would like a 3rd led to light on a 3rd pin with the led on the 2nd pin turning off when the servo returns to original position. I am attempting to make a scale train turnout control with a stop/go signal light.
So, what is the problem? Reading the state of a button (buttoned or unbuttoned) is hard, but reading the state of a switch(pressed or not pressed) is easy, IF the switch is wired correctly.
Turning an LED on or off is something a two year old can do.
Making a servo move is dirt simple, too.
You have a ridiculous amount of code for such simple requirements, and you forgot to tell us what that code actually does, or how that differs from what you want.
QUEUE *ftn_queue = new QUEUE[16];
A global pointer to dynamically allocated memory that never changes is completely pointless.
QUEUE ftn_queue[16];
Same result, but now the memory is static, which is what you want.
I got dizzy
reading your
code
that jerks around
all over the
place. Tools + Auto Format is NOT that difficult to use.