Help with Serial.Read() getting string.
int dword; void setup(){ serial.begin(9600); serial.write("power on"); } void loop(){ dword=serial.read(); if(dword=='1'){ serial.write("\nmotor 1 -> selected\n"); } if(dword=='2'){ serial.write("\nmotor 2 -> selected\n"); } /*if*dword=="m1"){ //do..... }*/ } how can can type strings? instead of single chars, there couple of ways go it. you read byte (that's serial.read returns; not int), , make decision based on character, read again. or, read available data, , store in array of characters. code: [select] char indata[20]; // allocate space string char inchar; // store character read byte index = 0; // index array; store character void loop() { while(serial.available() > 0) // don't read unless ...