using lsa08 with arduino

Talk about Arduino board, sheilds. Sharing Arduino projects, program, problems, solutions, suggestions..... many more, all are welcome.

using lsa08 with arduino

Postby safvan » Wed May 15, 2013 4:42 pm

hello,
i wanted to use cytron lsa08 line sensor on my arduino using uart. could anyone tell me how to do it?
safvan
Fledgling
 
Posts: 1
Joined: Wed May 15, 2013 4:38 pm

Re: using lsa08 with arduino

Postby waiweng83 » Thu May 16, 2013 9:24 am

Have you read through the user's manual?
With the power of dream, nothing is impossible...
User avatar
waiweng83
Moderator
 
Posts: 205
Joined: Wed Apr 15, 2009 2:17 pm

Re: using lsa08 with arduino

Postby Le0pa_RD » Mon Dec 11, 2017 3:03 am

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
Le0pa_RD
Freshie
 
Posts: 5
Joined: Mon Dec 11, 2017 2:59 am

Re: using lsa08 with arduino

Postby ober » Mon Dec 11, 2017 4:47 pm

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?
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: using lsa08 with arduino

Postby Le0pa_RD » Tue Dec 12, 2017 12:21 am

Can you post a working code please?
I checked my code but i don't understand what's wrong
Le0pa_RD
Freshie
 
Posts: 5
Joined: Mon Dec 11, 2017 2:59 am

Re: using lsa08 with arduino

Postby Idris » Tue Dec 12, 2017 6:08 pm

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.
Cytron Technologies invest time and resources providing tutorial, training and support for STEM education and maker movement. We need your support by purchasing products from Cytron Technologies. Thanks.
http://www.cytron.com.my
User avatar
Idris
Moderator
 
Posts: 409
Joined: Thu Mar 22, 2012 5:28 pm
Location: Pulau Pinang

Re: using lsa08 with arduino

Postby Le0pa_RD » Wed Dec 13, 2017 10:47 pm

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

  }
}
Le0pa_RD
Freshie
 
Posts: 5
Joined: Mon Dec 11, 2017 2:59 am

Re: using lsa08 with arduino

Postby Le0pa_RD » Sun Dec 24, 2017 3:30 am

I tried with software serial too...
No results
Anyone?
Le0pa_RD
Freshie
 
Posts: 5
Joined: Mon Dec 11, 2017 2:59 am

Re: using lsa08 with arduino

Postby ober » Tue Dec 26, 2017 8:59 am

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?
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: using lsa08 with arduino

Postby Le0pa_RD » Fri Dec 29, 2017 2:15 am

In the UARTMODE menu on the sensor...
Le0pa_RD
Freshie
 
Posts: 5
Joined: Mon Dec 11, 2017 2:59 am

Next

Return to Arduino Based

Who is online

Users browsing this forum: No registered users and 23 guests

cron