Can some one help review this code for Speedometer and Datalogging together

Hello all I am posting this for my 8th grader who is working on a science project


I am trying to make a speedometer for my long board and also record the data displayed on the speedo meter to a SD Card. I used the code listed and provided by leonardor on instructable (http://www.instructables.com/id/Arduino-Skateboard-Speedometer/) to get the speedometer to work. Everything works well and displays on the LCD display.

int val;
long last=0;
int stat=LOW;
int stat2;
int contar=0;
int displayrpm;

int sens=75;  // this value indicates the limit reading between dark and light,
              // it has to be tested as it may change acording on the 
              // distance the leds are placed.
int nPalas=1; // the number of blades of the propeller

int milisegundos=500; // the time it takes each reading

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);


void setup()
{
  Serial.begin(9600);
  pinMode(13,OUTPUT);
  lcd.begin(16,2);
}

void loop()
{
  val=analogRead(0);
  if(val<sens)
    stat=LOW;
   else
    stat=HIGH;
   digitalWrite(13,stat); //as iR light is invisible for us, the led on pin 13 
                          //indicate the state of the circuit.

   if(stat2!=stat){  //counts when the state change, thats from (dark to light) or 
                     //from (light to dark), remmember that IR light is invisible for us.
     contar++;
     stat2=stat;
   }
   if(millis()-last>=milisegundos){
     double rps=((double)contar/nPalas)/2.0*1000.0/milisegundos;
     double rpm=((double)contar/nPalas)/2.0*60000.0/(milisegundos);
     displayrpm=rpm;
     Serial.print((contar/2.0));Serial.print("  RPS ");Serial.print(rps);
     Serial.print(" RPM");Serial.print(rpm);Serial.print("  VAL ");Serial.println(val);
     contar=0;
     last=millis();
     Serial.print("   MPH  "); 
     Serial.print(rpm*0.0080622311);
     
     LCDPrint ();
   }
}

void LCDPrint ()
{
lcd.clear ();
lcd.setCursor (0,0);
lcd.print("MPH");
lcd.setCursor (0,1);
lcd.print(displayrpm*0.0080622311   );
lcd.setCursor (8,0);
lcd.print("RPM");
lcd.setCursor (8,1);
lcd.print(displayrpm);



return;
}

However when I add a SD card shield from Seeed Studio (similar to this one - http://www.seeedstudio.com/wiki/SD_Card_Shield_V3.0) and add the following code from the internet the display breaks but the SD Card datalogging works. Can someone look at my code and see what I am missing.

//Speedometer
int	val;	
long	last=0;	
int	stat=LOW;	
int	stat2;	
int	contar=0;	
int	displayrpm;	
int	sens=75;		//	this value indicates the limit reading between dark and light, it has to be tested as it may change
                                //	acording on the distance the leds are placed.	
int	nPalas=1;	        //	the	number	of	blades	of	the	propeller	
int	milisegundos=500;	//	the	time	it	takes	each	reading	

	
#include <LiquidCrystal.h>	

// Write to file
const int chipSelect = 10;
#include <SdFat.h>
SdFat sd;
SdFile myFile;	
String mphString ;
String rpmString ;
String StringtoPrint;

LiquidCrystal	lcd(12,	11,	5,	4,	3,	2);	

void	setup()	
{	
	Serial.begin(9600);	
	pinMode(13,OUTPUT);	
	lcd.begin(16,2);	
}	

void	loop()	
{	
	val=analogRead(0);	
	if(val<sens)	
		stat=LOW;	
	else	
		stat=HIGH;	
	digitalWrite(13,stat);	//as	iR	light	is	invisible	for	us,	the	led	on	pin	13		
				//indicate	the	state	of	the	circuit.	
	if(stat2!=stat){		//counts	when	the	state	change,	thats	from	(dark	to	light)	or		
				        //from	(light	to	dark),	remmember	that	IR	light	is	invisible	for	us.	
			contar++;	
			stat2=stat;	
			}	
	if(millis()-last>=milisegundos){	
			double	rps=((double)contar/nPalas)/2.0*1000.0/milisegundos;	
			double	rpm=((double)contar/nPalas)/2.0*60000.0/(milisegundos);	
			displayrpm=rpm;	
			Serial.print((contar/2.0));Serial.print("		RPS	");
                        Serial.print(rps);						
                        Serial.print("	RPM");
                        Serial.print(rpm);
                        Serial.print("		VAL	");
                        Serial.println(val);	
			contar=0;	
			last=millis();	
			Serial.print("			MPH		");		
                        Serial.print(rpm*0.0080622311);	
                        LCDPrint	();
  
                        //write to file routine                                      
                        if (!sd.begin(chipSelect, SPI_HALF_SPEED)) sd.initErrorHalt();

                        // open the file for write at end like the Native SD library
                          if (!myFile.open("datalog.txt", O_RDWR | O_CREAT | O_AT_END)) {
                              sd.errorHalt("opening datalog.txt for write failed");
                                }
                                // if the file opened okay, write to it:
                                //Serial.print("Writing to datalogdatalogdatalog.txt...");
                                String mphString = String(analogRead(rpm*0.0080622311));
                                String rpmString = String(analogRead(displayrpm));
                                String StringtoPrint = ("Wheel Size is XXXXXX,MPH," + (mphString) + ",RPM," + (rpmString)) + "\n";
                                myFile.println (StringtoPrint);
                               

                               // close the file:
                                myFile.close();
                                          }			

}	

void	LCDPrint	()	

{	

lcd.clear	();	
lcd.setCursor	(0,0);	
lcd.print("MPH");	
lcd.setCursor	(0,1);	
lcd.print(displayrpm*0.0080622311			);	
lcd.setCursor	(8,0);	
lcd.print("RPM");	
lcd.setCursor	(8,1);	
lcd.print(displayrpm);	
return;	
}

Your SD Card Shield uses pins 10, 11, 12, and 13. You are trying to also use pins 11 and 12 for your LCD and 13 for your LED.

Thank you so much @johnwasser. It works like a charm... thank you thank you ...