Go Down

Topic: using LV4 CCD barc barcode scanner with Arduino (Read 339 times) previous topic - next topic

hosein123

Dec 10, 2018, 10:15 am Last Edit: Dec 10, 2018, 10:34 am by 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 .  below is my schematic design . but i can not receive any data on Arduino serial port
my code :
Code: [Select]
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);
}
}
}

AWOL

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

hosein123

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

hosein123

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.

hosein123

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

Paul__B

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.

Go Up