using LV4 CCD barc barcode scanner with Arduino

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);
}
}
}

Capture.PNG

Untitled.png

I'm not sure "void" and "else" tolerate being broken across a newline like you have.

there is no error in my Codes but i get nothingd :frowning:

AWOL: I'm not sure "void" and "else" tolerate being broken across a newline like you have.

i corrected that in my post , but i successfully upload code in Arduino but i receive nothing in serial port.

Is my connections ok? schematic design is attached in my post.

hosein123: 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

Implies wiring blunder.