MMA7361 + TLC5940 BAR GRAPHs

Hi i have got my code working it displays the angles on the LCD and outputs the angle in 10 degree increments on the led's its starts in the center of the bar and displays left and right and up and down from center on the bars just a quick question how do i make it so when it moves the led's from the center of the bar they stay lit so at say 30 degrees 3 led's on the bar will be on

here is my code thanks

#include "Tlc5940.h"
#include <math.h>
#define M_PI 3.1415926535897932
#include <LiquidCrystal.h>


// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(41, 39, 35, 33, 31, 29);

int pinsx[] = {
  1,2,3,4,5,6,7,8,9,10};

int pinsy[] = {
  17,18,19,20,21,22,23,24,25,26};
  
const int yledCount = 10;    // the number of LEDs in the bar graph
const int xledCount = 10;    // the number of LEDs in the bar graph
const int buttonPin = 52;     // the number of the pushbutton pin
const int ledPin =  6;
  
  
// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

int xPin = 0;
int yPin = 1;
int selPin = 42;
int sleepPin = 44;

float xValue, yValue, zValue;
float gxValue, gyValue, gzValue;
float degxValue, degyValue, degzValue;;
const float scalePoints = 1023/5;

float calValues[4] = {0,0};
int numReadings = 0;
int maxNumReadings = 20;
long dt = 250;
long lastTime = 0;


void setup() {
  Serial.begin(9600);
  digitalWrite(sleepPin,HIGH);
  digitalWrite(selPin,LOW);
  analogReference(EXTERNAL); 
  getCalValues();
  // set up the LCD's number of columns and rows: 
  lcd.begin(16, 2);
  // loop over the pin array and set them all to output:
  // set up the LCD's number of columns and rows: 
  pinMode(buttonPin, INPUT);
    Tlc.init();
}

void loop() {
  
 buttonState = digitalRead(buttonPin);

  xValue = analogRead(xPin);
  yValue = analogRead(yPin);
  
  gxValue = constrain((xValue/scalePoints-1.65-calValues[0])/0.8,-1,1);
  gyValue = constrain((yValue/scalePoints-1.65-calValues[1])/0.8,-1,1);
  
  degxValue = asin(gxValue)/M_PI*180;
  degyValue = asin(gyValue)/M_PI*180;

  Serial.print(degxValue,1); Serial.print("   "); lcd.setCursor(2,0); lcd.print( "U + D = "); lcd.print(degxValue,0 ); lcd.print(" Deg ");
  Serial.print(degyValue,1); Serial.print("   "); lcd.setCursor(2,2); lcd.print( "L + R = "); lcd.print(degyValue,0 ); lcd.print(" Deg ");
  Serial.println("\t"); Serial.println("\t");  
    
  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {    
    // turn LED on:    
    digitalWrite(ledPin, HIGH);  
  }
  else {
    // turn LED off:
    digitalWrite(ledPin, LOW);
  
  
 
  int xbar1 = map(degxValue, 90, -90, 0, 9);
  int xbar = constrain(xbar1, 0, 10);
  for (int channel = xbar; channel < xbar+1; channel++) {
  Tlc.set(pinsy[channel], 4095);

  int ybar1 = map(degyValue, 90, -90, 0, 9); 
  int ybar = constrain(ybar1, 0, 10);
  for (int channel = ybar; channel < ybar+1; channel++) {
  Tlc.set(pinsx[channel], 4095);
  {
     Tlc.update();
     Tlc.clear();
     delay(300);
     break;}
      }
    }
  }
}
void getCalValues() {
  while (numReadings < maxNumReadings)
    if (millis() - lastTime > dt) {
      calValues[0] = calValues[0] + analogRead(xPin);
      calValues[1] = calValues[1] + analogRead(yPin);
      lastTime = millis();
      numReadings++;
  }
  calValues[0] = (calValues[0] / maxNumReadings)/scalePoints-1.65;
  calValues[1] = (calValues[1] / maxNumReadings)/scalePoints-1.65;
}