Use CTRL T to format your code.
Attach your ‘complete’ sketch between code tags, use the </> icon in the posting menu. [code]Paste your sketch here[/code]
If you are feeding more than 5v to an I/O pin DON’T.
Well what you posted isn't real code but in your setup() you change the pin number of systemButtonPin from 2 to 0. That is why changes on pin 2 don't do anything. Perhaps you meant systemButtonState?
If you post the actual code you may get better answers.
Is your switch setup similar to the following diagram of Fig-1?
Figure-1:
Codes to check that K1 is closed:
void setup()
{
Serial.begin(9600);
pinMode(2, INPUT);
pinMode(13, OUTPUT); //built-in L (LED) of UNO
digitalWrite(13, LOW); //L is initially OFF
do
{
;
}
while(digitalRead(2) != HIGH);
digitalWrite(13, HIGH); //L is ON because K1 is closed and DPin-2 is at HIGH state.
}
void loop()
{
}
Press down K1 and check that L is ON. It establishes that HIGH has appeared at DPin-2 of Fig-1.