Hi i am trying to read lv4 ccd barcode scanner module output using arduino uno , i am using max3232 to convert
RS232 to TTL , i connected max3232 vcc to 3.5 v because it is getting too hot on 5v . below is my schematic design . but i can not receive any data on Arduino serial port
my code :
String code = ""; //initialize the output string
char endbit=0; //a flag to mark 0D received
void setup()
{
Serial.begin(9600); //initialize the Serial port
}
void loop()
{
int temp; //temporary storage of data received
if(Serial.available()>0)
{
temp=(Serial.read()); //read the input data
if(temp==0x0D)
{
endbit=1;
}
else if((temp==0x0A)&&(endbit=1)&&(code.length()>0)) //0D+0A received in order, so it comes to the end of string
{
Serial.println(code);
code="";
endbit=0;
}
else
{
code +=char(temp);
}
}
}

