you are comparing a single character, which may be 'S' which is the first character in teh string "Sensor 1", with, again, A string literal which you have declared as a character.
In C programming a single quote ' mark means that its an ASCII character, like '&' or 's'. If you want a string, you use doublequote, "Sensor" and even single character strings work "S".
What you need to do is set up a char buffer as an empty "string" for the received data.
char rxbuffer[64]; //64 byte long char buffer!
memset (rxbuffer,0,64); //this clears the bytes to 0. otherwise could be garbage data
64 is arbitrary, but means it can hold 63 character long string, and a null terminator at the end.
then you should use the arduino Serial.readBytesUntil() function. http://arduino.cc/en/Serial/ReadBytesUntil
This would looke like:
//you need to include this at the top!!
#include <string.h>
if(Serial.available()){
Serial.readBytesUntil('\0', rxbuffer, 64);
//use the C++ standard function call strstr to search buffer for matchin
//input string
//was it sensor 1 command?
if( strstr(rxbuffer, "Sensor 1") ){
digitalWrite(LED1, HIGH);
}else{
//maybe it was sensor 2?
if( strstr(rxbuffer, "Sensor 2") ){
digitalWrite(LED2, HIGH);
}
} //end if it wasnt first sensor message
}//end serial available, processing message after read
So there you go, that should work. change the LED pin numbers/names though
The BA1404 does transmit audio, in stereo.
Whether they are suitable for use together depends on the frequency you use; on whether the receiver circuit will handle the +/-75kHz modulation that the BA1404 will do to the carrier; whether it uses the same time constant for de-emphasis that the transmitter uses for pre-emphasis; whether has a stereo decoder; and of course on whether they are located close enough together for the power of the transmitter to excite the sensitivity of the receiver.
NB The link is incorrect in saying that C13/14 are part of the pre-emphasis circuit. They aren't. It is a simple RC high-pass formed by R6/C15 and R7/C16 respectively. These values will give you 50uS pre-emphasis.
As the receiver is built for 88-108MHz I think it is safe to assume it will handle the modulation, but I don't see any stereo decoder in the receiver circuit. So the answer is 'no' unless you arrange to broadcast in mono, by killing the 19kHz pilot tone in the transmitter, or append a suitable decoder, e.g. the one at http://www.fmmpx.com, which I've built many times for modernising several brands and models of FM tuner.
I would add that the receiver looks pretty basic. I would expect high distortion and poor stereo if any. There are better circuits around. Indeed you don't even need one: just use an old FM tuner. This one talks about component numbers in the text but doesn't show them in the schematic, which isn't too encouraging.
Best Answer
It looks like it should but the art to getting things working is breaking the job into smaller slices (metaphor warning!). For instance, build the transmitter first and test it with a regular FM radio that are cheap and easy to get hold of.
Once you are happy the transmitter is working, get the receiver working by listening into FM broadcast transmissions.
Then bring the two together and test.
A BIG WORD of warning - many countries will have laws against building and using FM transmitters. Use the shortest antenna you can to prove it works then if you decide to make the antennas bigger nobody's going to be knocking on my door.