Hi folks,
I am working with a Mega 2560 that will, in the final project, be receiving signals from multiple RFID readers which will result in the Mega sending serial commands via RS-232 to an audio repeater.
The command structure required by the audio repeater needs all commands in ASCII with a format of various letter commands
I am able to send the various letter commands, "p+19" in this case, no problem. Its the and the commands that I haven't been able to send. I know the ASCII keystrokes for these are ctrl-a and ctrl-c respectively but I have not been able to send these through the Serial.print command.
Currently I have been trying the decimal and now Hex number equivalents for these commands but that isn't working either.
I have successfully sent this command string from my terminal emulator (Tera Term) and the audio repeater has played the file as directed. I just cant get it from my Mega.
Here's my test code:
int loopstate=1;
void setup() {
Serial.begin(2400); //baude rate slowed down for CFSoundIII
// while (!Serial); // wait for serial port to connect. Needed for native USB port only
}
void loop()
// Send string to tell CFSoundIII - start of header, play file 25 - in HEX -, and end of text:
{
if(loopstate==1){
Serial.print(0x1);
Serial.print("p+19");
Serial.println(0x3);
}
{
loopstate=loopstate-1; //This sets the loopstate so the Serial.print commands send only once
//The following lines are for debugging
//Serial.print(loopstate);
//Serial.println(" ");
delay (1000);
}
}
So, any thoughts from the collective mind?
Thanks, I appreciate any feedback.