I am new to programing and have a few questions. First what I want to do, when a button is pressed I want to start a 60 second program that will have to send a serial command to a video player, and make a digital pin high. After the 60 seconds I need it to count how many switches are closed, send another serial command based on how many switches are closed, wait 5 seconds turn the pin back to low, play a serial command to change the video and wait for someone to push the start button to start it all over again.
What I don't know is how can I do the adding of the switches? I am using a Mega and plan on having 30-40 switches.