Test first character in serially sent string


i take ascii number , convert actual character shown in following example program.  is there function this?

code: [select]
void setup(){
 serial.begin(9600);
}

void loop()
{
 string strarray[200];
 if (serial.available()>0)
 {
   int = 0;
   while(serial.available() > 0)
   {
     strarray[i] = serial.read();
     serial.print("array number ");
     serial.print(i);
     serial.print(" ");
     serial.print(strarray[i]);
     serial.print(" ascii # character ");
     serial.println(strarray[i]);  // <== how can # converted character
     i++;
   }
   strarray[i] = '\0';
 }
}

strarray array of 200 strings... meant be? or should array of 200 chars?

cast char? serial.println((char) 64);


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Test first character in serially sent string


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums