first i checked the serial input of aurdino thts y i wrote this program
#include <LiquidCrystal.h>
String incoming = 0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
lcd.begin(16, 2);
lcd.print("ARMCET");
Serial.begin(9600);
}
void loop()
{
lcd.setCursor(0, 1);
if (Serial . available() > 0) {
incoming = Serial.read();
lcd.println( incoming );
Serial.print(incoming );
}
}
in this when i declared as char it shows the card no as 16703301 but when i change the decleration as string it shows card no as 49545548515148491310
in the below prg i declered as string only #include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
String readString;
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
}
void loop() {
//expect a string like wer,qwe rty,123 456,hyre kjhg,
//or like hello world,who are you?,bye!,
lcd.setCursor(0, 1);
while (Serial.available()) {
delay(10); //small delay to allow input buffer to fill
char c = Serial.read(); //gets one byte from serial buffer
if (c == ',') {break;} //breaks out of capture loop to print readstring
readString += c; } //makes the string readString
if (readString.length() >0) {
Serial.println(readString); //prints string to serial port out
if(readString =="16703301<CR><LF>")// here i changed to "49545548515148491310" but when card shown it is not executing this loop
{
Serial.print("hello");
lcd.print("hello");
}
else if(readString == 16705890)
{
Serial.print("HI");
lcd.print("hi");
}
else
{
Serial.print("enterno");
lcd.print("enter no");
}
readString=""; //clears variable for new input
}
}