You should never post in the Uncategorised section.
It says so in the description of the section. Therefore I have moved your post here.
You might want to look at this How to get the best out of this forum before you proceed any further.
We also need to see a schematic to help you with this problem because the code alone doesn't tell the full story. A wiring list doesn't cut it in electronics.
Why do you want to reset the board in the first place? That sounds like badly designed software.
Is your nano a clone? It could be the switches are sub standard.