I'm trying to take command using serial monitor in string or integer form but every time i print the data entered through serial monitor it prints random characters (or may be there is a pattern and i can't see it)
I'm using an ardiuno nano and am using android device to program it.
Serial.begin(112500);
}
// the loop routine runs over and over again forever:
void loop() {
//char k[10];
// read the input on analog pin 0:
String a;
a =Serial.readString();
try 115200, instead of 112500
and set the Arduino IDE to the same baud rate.
Also if you are reading Strings from Serial check out my Arduino Software Solutions
for various ways to read from Serial with their pros and cons