int UY = 0;
int UX = 0;
#include "LedControl.h" // library
LedControl lc=LedControl(13,11,12,1); //11 is to CLOCK, 12 = CS, 13=DIN//
void setup() {
Serial.begin(9600);
lc.shutdown(0,false);
lc.setIntensity(0,8);// sets brightness
lc.clearDisplay(0);// clear screen
}
void loop() {
UY = analogRead(A5);
UX = analogRead(A4);
char x_translate = map(UX, 1021, 0, 7, 0);
char y_translate = map(UY, 1021, 0, 0, 7);
Serial.print(", LR = ");
Serial.print(UX, DEC);
Serial.print("UD = ");
Serial.print(UY, DEC);
Serial.print(", x = ");
Serial.println(y_translate, DEC);
Serial.print(", x = ");
Serial.print(x_translate, DEC);
Serial.print(", y = ");
lc.clearDisplay(0);
lc.setLed(0,x_translate,y_translate,true);
delay(150);
}