How to...

Hello everyone.

I'm pretty much a noob when it comes to the arduino and I am still learning how to use it correctly. My question is... How can I for example Take a program like the Servo Sweep program and the PIR sensor program, compile it into one and have it run on the same I/O board. I know both programs will need different set pins for the devices, I just need to know how to include a program like the Sweep program with the PIR program and have it run simultaneously on one board.

Thank You,


In essence: merge the global vars, merge the setups() into one merge the loops() into one

Take care that vars with the same name do not conflict,

Get the timing right,

Better approach start from scratch with a good design how it should work (draw the storyboard on a big paper, works all the time)