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);
}
}