Page 1 of 2
using lsa08 with arduino
Posted:
Wed May 15, 2013 4:42 pm
by safvan
hello,
i wanted to use cytron lsa08 line sensor on my arduino using uart. could anyone tell me how to do it?
Re: using lsa08 with arduino
Posted:
Thu May 16, 2013 9:24 am
by waiweng83
Have you read through the user's manual?
Re: using lsa08 with arduino
Posted:
Mon Dec 11, 2017 3:03 am
by Le0pa_RD
Hi,
I tried lsa08 with serial UART communication
It works with digital output (UART mode 1) but it doesent with (UART mode 3)
anyone can help?
Thanks
Re: using lsa08 with arduino
Posted:
Mon Dec 11, 2017 4:47 pm
by ober
If it works on UART mode 1, the LSA08 is working, I think you need to check your code. How your code handle the payload?
Re: using lsa08 with arduino
Posted:
Tue Dec 12, 2017 12:21 am
by Le0pa_RD
Can you post a working code please?
I checked my code but i don't understand what's wrong
Re: using lsa08 with arduino
Posted:
Tue Dec 12, 2017 6:08 pm
by Idris
Hi Le0pa_RD,
Could you share a few clear photos/videos of your hardware setup? Including the code that you write to Arduino.
Currently I don't have a sample code for LSA08.
Re: using lsa08 with arduino
Posted:
Wed Dec 13, 2017 10:47 pm
by Le0pa_RD
This is my code.
Nothing wrong with the hardware.
UART mode 2 works as well it's just mode 3
can anyone help?
- CODE: SELECT_ALL_CODE
const byte rx = 0;
const byte tx = 1;
const byte serialEn = 6;
int data[9];
void setup() {
pinMode(serialEn,OUTPUT);
digitalWrite(serialEn,HIGH);
Serial.begin(9600);
}
void loop() {
byte dummy = 0;
for(int i=0; i<9; i++){
digitalWrite(serialEn,LOW);
while(Serial.available() <= 0);
dummy = Serial.read();
digitalWrite(serialEn,HIGH);
data[i] = dummy;
}
if(data[0] != 0)
Serial.println("Array not valid");
else{
Serial.print("Array: ");
for(int i=1; i<9; i++){
Serial.print(data[i]);
}
Serial.println();
}
}
Re: using lsa08 with arduino
Posted:
Sun Dec 24, 2017 3:30 am
by Le0pa_RD
I tried with software serial too...
No results
Anyone?
Re: using lsa08 with arduino
Posted:
Tue Dec 26, 2017 8:59 am
by ober
Le0pa_RD WROTE:This is my code.
Nothing wrong with the hardware.
UART mode 2 works as well it's just mode 3
can anyone help?
- CODE: SELECT_ALL_CODE
const byte rx = 0;
const byte tx = 1;
const byte serialEn = 6;
int data[9];
void setup() {
pinMode(serialEn,OUTPUT);
digitalWrite(serialEn,HIGH);
Serial.begin(9600);
}
void loop() {
byte dummy = 0;
for(int i=0; i<9; i++){
digitalWrite(serialEn,LOW);
while(Serial.available() <= 0);
dummy = Serial.read();
digitalWrite(serialEn,HIGH);
data[i] = dummy;
}
if(data[0] != 0)
Serial.println("Array not valid");
else{
Serial.print("Array: ");
for(int i=1; i<9; i++){
Serial.print(data[i]);
}
Serial.println();
}
}
How you do configure the LSA08 into mode 3?
Re: using lsa08 with arduino
Posted:
Fri Dec 29, 2017 2:15 am
by Le0pa_RD
In the UARTMODE menu on the sensor...