Problem about using Propeller C to control the text-to-speech module.
Jarvan
Posts: 31
#include "simpletools.h" // Include simple tools
#include "fdserial.h"
#include "simpletext.h"
fdserial *emic;
char speak[] ={"hello"};
int main()
{
print("Emic2 start\n");
emic = fdserial_open(9, 8, 0, 9600);
print("waiting for Emic2...\n");
pause(1000);
fdserial_txChar(emic,'S');
pause(200);
fdserial_txChar(emic, &speak);
pause(200);
fdserial_txChar(emic, "D1\n");
}
#include "fdserial.h"
#include "simpletext.h"
fdserial *emic;
char speak[] ={"hello"};
int main()
{
print("Emic2 start\n");
emic = fdserial_open(9, 8, 0, 9600);
print("waiting for Emic2...\n");
pause(1000);
fdserial_txChar(emic,'S');
pause(200);
fdserial_txChar(emic, &speak);
pause(200);
fdserial_txChar(emic, "D1\n");
}
Comments
If I had to guess, it's because you're passing a pointer to the fdserial_txChar function, which only takes literal bytes. You'll need to write a loop to iterate over your strings and output the characters one by one.
#include "simpletools.h"
#include "fdserial.h"
fdserial *emic;
char speak[] ={"hello"};
int main()
{
print("Emic2 start\n");
emic = fdserial_open(9, 8, 0, 9600);
print("waiting for Emic2...\n");
pause(1000);
writeChar(emic,'S');
pause(200);
dprint(emic, &speak);
pause(200);
dprint(emic, "D1\n");
}
[/php]