how to use array for my project. please help me

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 :frowning: 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();
  }
    }
  }

Please edit your post and put code tags around the code instead of quote tags.

...and turn off the right-justification

sorry i new in this forum :slight_smile: and done fix my post

void memulai()
{
 
 int flex4 = analogRead(tanda);
  int D = map(flex4,220,0, 0,90);

   if (D > 30)
      {
      masukan();
      }
      else 
      {
        memulai();

Recursion is a very bad idea on a RAM-deficient microcontroller

oke what should i do now for my code? can u give me some advice or example?

You should remove the recursion.

if (C > 30)
  {
    
    TextToSpeech.say(myarray);
    memulai;    
    }

What's that supposed to do?