Stuck in loop?

Hello, i'm currently working on a robot project, it's a pretty simple robot, it can move 5 servos, detect when someone walks by (pir motion sensor) and play sounds from a serial mp3 board, and also a wii nunchuck attached to override the sensor when i want to take manual control.

Now all the individual components work, and i created a script to do the multitasking, which partly works. and that's why i'm here, some things aren't working as they're supposed to. Right now the issue is that it checks for nunchuck input, nut somehow it constantly registers all buttons to be pressed and keeps stuck in that loop. even though before the nunchuck behaved as it should.
Could someone review my code and see if i made some mistakes or if there's a better solution to it?

nunchuck_funcs.h (5.2 KB)

MainCode.ino (10.6 KB)

Okay so i resolved most of the issue, i removed the "else" part in the main loop, and noticed i actually reversed 2 pins for the nunchuck.
so now i can use the nunchuck for commands again.
Now i have a function called CheckSensor, and when i put this anywhere in my main loop it doesn't run it anymore..
soo if there's any solution to that, i would love to hear

Now i have a function called CheckSensor, and when i put this anywhere in my main loop it doesn't run it anymore..

"it" is a pronoun. You used it twice in that sentence. Neither time does it refer to anything.

You changed your code. You get to post it again.

I uploaded the updated code

I uploaded the updated code

So, now we can compare your current code to your previous code, to see what you changed, right?

DO NOT DO THAT AGAIN!!!!

PaulS:
So, now we can compare your current code to your previous code, to see what you changed, right?

DO NOT DO THAT AGAIN!!!!

Got it, can you clarify exactly why not to do it again, and how i SHOULD do it.
I can't say i'm a programmer so i don't know how you guys work.

I can't say i'm a programmer so i don't know how you guys work.

It is not a matter of being a programmer or not. It is a matter of keeping the original code in the original post and changes in the replies. Put the original code back in the original post. Put the revised code in the next reply.