don't worry about this

here is the code

#include <LedControl.h>

const int SWpin = 2; // digital pin connected to switch output
const int Xpin = 0; // analog pin connected to X output
const int Ypin = 1; // analog pin connected to Y output
LedControl lc=LedControl(12,10,11,1);

void setup() {
  // put your setup code here, to run once:
  pinMode(SWpin, INPUT);
  digitalWrite(SWpin, HIGH);
    Serial.begin(9600);
    /*
   The MAX72XX is in power-saving mode on startup,
   we have to do a wakeup call
   */
    lc.shutdown(0,false);
  /* Set the brightness to a medium values */
  lc.setIntensity(0,8);
  /* and clear the display */
  lc.clearDisplay(0);
}
void loop(){
if (Xpin==0 & Ypin==0)//if the joystick goes to (0,0) then it will tell the 8x8 matrix to light (0,0)
 {
 byte a[2]{B10000000,B10000000};
 lc.setRow(0,0,a[1]);
 digitalWrite(13,LOW);
}
else
{
   byte a[2]{B10000000,B00000000};
 lc.setRow(0,0,a[2]);
}

if (SWpin==0);{
  lc.setIntensity(0,8);
}
}

I tried it with both of my boards my Mega 2560 R3 and Uno R3 and hook up with the joystick and the Max7219 8x8 dot matrix module and the program still does nothing

I test an program with if code and it did nothing here is the program

void setup() {
  // put your setup code here, to run once:
int light = 13;
}

void loop() {
  // put your main code here, to run repeatedly:
delay(500);
digitalWrite(13,LOW);
if (13==LOW)
{digitalWrite(13, HIGH);
}
delay(500);
digitalWrite(13,LOW);
}
[code]

13 is never going to be LOW. Did you perhaps mean digitalRead(13)?

Steve

slipstick:
13 is never going to be LOW. Did you perhaps mean digitalRead(13)?

Steve

thx
i test it out but still did not work

  pinMode(SWpin, INPUT);
  digitalWrite(SWpin, HIGH);

is equivalent to:

  pinMode(SWpin, INPUT_PULLUP);

Is that what you intended? How is your switch wired?

Please post the latest version of your code.