getSurreal / XV_Lidar_Controller

Arduino code for controlling the Neato XV Lidar
Apache License 2.0
128 stars 47 forks source link

Tx pin 8 usage serial communication #1

Closed jbourne15 closed 9 years ago

jbourne15 commented 9 years ago

Hi,

I modified your code to use the Tx pin 8 to transmit data to another device. When I do this the data transmits inconsistently. For example, normally when I print to the serial monitor it give consistent 0-359 angle readings, however when I try to serial1.print(angle) the angle reports are inconsistent (sometimes it is 0-291 and sometimes it is 0-512 and so forth). I was wondering if anyone has any ideas of what is going on, because I am at a lost.

thanks,

JB

getSurreal commented 9 years ago

I suspect that you're dropping packets. You could try slowing the RPM to 200 to reduce the amount of data and see if that helps. Also make sure you eliminate any other serial.prints that aren't needed at the time. The angle number is based on detecting the first packet and then incrementing the number as it processes data. If packets get dropped it will throw that information off. I will look at updating the code to more specifically look at the packet for calculating the angle.

On 2/11/2015 12:56 AM, jbourne15 wrote:

Hi,

I modified your code to use the Tx pin 8 to transmit data to another device. When I do this the data transmits inconsistently. For example, normally when I print to the serial monitor it give consistent 0-359 angle readings, however when I try to serial1.print(angle) the angle reports are inconsistent (sometimes it is 0-291 and sometimes it is 0-512 and so forth). I was wondering if anyone has any ideas of what is going on, because I am at a lost.

thanks,

JB

— Reply to this email directly or view it on GitHub https://github.com/getSurreal/XV_Lidar_Controller/issues/1.

jbourne15 commented 9 years ago

Worked perfectly, thank you so much!!

JB

On Wed, Feb 11, 2015 at 12:12 PM, getSurreal notifications@github.com wrote:

I suspect that you're dropping packets. You could try slowing the RPM to 200 to reduce the amount of data and see if that helps. Also make sure you eliminate any other serial.prints that aren't needed at the time. The angle number is based on detecting the first packet and then incrementing the number as it processes data. If packets get dropped it will throw that information off. I will look at updating the code to more specifically look at the packet for calculating the angle.

On 2/11/2015 12:56 AM, jbourne15 wrote:

Hi,

I modified your code to use the Tx pin 8 to transmit data to another device. When I do this the data transmits inconsistently. For example, normally when I print to the serial monitor it give consistent 0-359 angle readings, however when I try to serial1.print(angle) the angle reports are inconsistent (sometimes it is 0-291 and sometimes it is 0-512 and so forth). I was wondering if anyone has any ideas of what is going on, because I am at a lost.

thanks,

JB

— Reply to this email directly or view it on GitHub https://github.com/getSurreal/XV_Lidar_Controller/issues/1.

— Reply to this email directly or view it on GitHub https://github.com/getSurreal/XV_Lidar_Controller/issues/1#issuecomment-73943969 .

getSurreal commented 9 years ago

v1.2.2 just published will maintain angle data when using the ShowAngle command even if dropping packets.