SD, LCD and Virtual Wire interface

I am using these three libraries in my final year project the code looks like this but it is not displaying the message received on the LCD on the serial port its good the code is here,
the LCD display some random characters

#include <SD.h>
#define SD_ChipSelectPin 4
#include <TMRpcm.h>
#include <SPI.h>
#include<VirtualWire.h>
#include<LiquidCrystal.h>
TMRpcm tmrpcm;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
unsigned long time = 0;

void setup(){

vw_set_ptt_inverted(true);
vw_setup(2000);

vw_rx_start();
tmrpcm.speakerPin = 9;

Serial.begin(9600);
pinMode(13,OUTPUT);
if (!SD.begin(SD_ChipSelectPin)) {
lcd.print(“SD fail”);
return;

}
else{
lcd.print(“SD ok”);
}
tmrpcm.play(“welcome”);
}

void loop(){

char msg;
char dummy;
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;

if (vw_get_message(buf, &buflen)) // Non-blocking
{
int i;

for (i = 0; i < buflen; i++)
{
dummy=buf*;*

  • }}*
    if(msg!=dummy)
    {

  • if(tmrpcm.isPlaying() && millis() - time > 50 ) { *

  • digitalWrite(13,!digitalRead(13));*

  • time = millis(); *

  • }else*

  • if(millis() - time > 500){ *

  • digitalWrite(13,!digitalRead(13));*

  • time = millis();*

  • }*

  • switch(dummy){*

  • case ‘a’: tmrpcm.play(“a”); break;*

  • case ‘b’: tmrpcm.play(“b”); break;*

  • case ‘c’: tmrpcm.play(“c”); break;*

  • case ‘d’: tmrpcm.play(“d”); break;*

  • case ‘e’: tmrpcm.play(“e”); break;*

  • case ‘f’: tmrpcm.play(“f”); break;*

  • case ‘g’: tmrpcm.play(“g”); break;*

  • case ‘h’: tmrpcm.play(“h”); break;*

  • case ‘i’: tmrpcm.play(“i”); break;*

  • case ‘j’: tmrpcm.play(“j”); break;*

  • case ‘k’: tmrpcm.play(“k”); break;*

  • case ‘l’: tmrpcm.play(“l”); break;*

  • case ‘m’: tmrpcm.play(“m”); break;*

  • case ‘n’: tmrpcm.play(“n”); break;*

  • case ‘o’: tmrpcm.play(“o”); break;*

  • case ‘p’: tmrpcm.play(“p”); break;*

  • case ‘q’: tmrpcm.play(“q”); break;*

  • case ‘r’: tmrpcm.play(“r”); break;*

  • case ‘s’: tmrpcm.play(“s”); break;*

  • case ‘t’: tmrpcm.play(“t”); break;*

  • case ‘u’: tmrpcm.play(“u”); break;*

  • case ‘v’: tmrpcm.play(“v”); break;*

  • case ‘w’: tmrpcm.play(“w”); break;*

  • case ‘x’: tmrpcm.play(“x”); break;*

  • case ‘y’: tmrpcm.play(“y”); break;*

  • case ‘z’: tmrpcm.play(“z”); break;*

  • default: break;*

  • } *

  • }*
    else{
    }
    msg=dummy;
    }

The VirtualWire uses a timer, so does the TMRpcm library. Why do you need the TMRpcm library ? can you give a link to the one you use ? (just copy the url in the text). Do you use it for audio output ? That might need everything of the Arduino, I wonder if it can do anything else at that moment.

You could make a test sketch with only the display, saying for example "hello world". To be sure that the display is working.

I have already made it and the display is working but it do not play any thing can i change the timer from the library. I need to receive the letters through the RF receiver and play the respective sound with that letter from the SD card. I am using the library https://github.com/TMRh20/TMRpcm

Did you have a look at the source code ? TMRpcm is using TIMER1. VirtualWire is using TIMER1. You can't use both of those libraries =(

#define SD_ChipSelectPin 4 
#include <TMRpcm.h>           
#include <SPI.h>
#include<VirtualWire.h>
#include<LiquidCrystal.h>
TMRpcm tmrpcm;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
unsigned long time = 0;

void setup(){

  vw_set_ptt_inverted(true);
    vw_setup(2000);   

    vw_rx_start();
  tmrpcm.speakerPin = 9;

  Serial.begin(9600);
  pinMode(13,OUTPUT);
  if (!SD.begin(SD_ChipSelectPin)) {

Is pin 4 the chip select pin OR is it part of the LCD connection? Both is the wrong answer.