what wrong with my array on my code. for this project im use LCD one sheeld and TexttoSpeech onesheeld and some sensor (flex/Bend sensor). i just want TextToSpeech can Said character that swrite on the LCD but when im using my code TextToSpeech just said 'W'. please give me some advice thanks
this is my code
#define CUSTOM_SETTINGS
#define INCLUDE_LCD_SHIELD
#define INCLUDE_TEXT_TO_SPEECH_SHIELD
#include <OneSheeld.h>
int jarimanis = A0;
int jaritelunjuk = A1;
int tanda = A5;
int bicara = A2;
int i = 0;
void setup()
{
Serial.begin(9600);
OneSheeld.begin();
}
void loop()
{
LCD.begin();
memulai();
}
void memulai()
{
int flex4 = analogRead(tanda);
int D = map(flex4,220,0, 0,90);
if (D > 30)
{
masukan();
}
else
{
memulai();
}
}
void masukan()
{
int flex1 = analogRead(jarimanis);
int flex2 = analogRead(jaritelunjuk);
int flex3 = analogRead(bicara);
int A = map(flex1, 517,300, 0, 90);
int B = map(flex2,520,250, 0,90);
int C = map(flex3, 531,220, 0, 90);
char myarray[16];
if (C > 30)
{
TextToSpeech.say(myarray);
memulai;
}
else
{
if (B >30 && A >30)
{
LCD.write('A');
OneSheeld.delay(5000);
myarray[i] = 'A';
i++;
memulai();
}
if (B <30 && A <30)
{
LCD.write('B');
OneSheeld.delay(5000);
myarray[i] = 'B';
i++;
memulai();
}
if (B <30 && A >30)
{
LCD.write('C');
OneSheeld.delay(5000);
myarray[i] = 'C';
i++;
memulai();
}
if (B >30 && A <30)
{
LCD.write('D');
OneSheeld.delay(5000);
myarray[i] = 'D';
i++;
memulai();
}
}
}