Hi,
I’m using Leddartech Leddar one http://www.robotshop.com/en/leddartech-leddarone-optical-rangefinder-rs-485.html for obstacle avoidance and I’m using RS-485 breakout board to connect the Orangutan x2 with lidar.
http://www.robotshop.com/en/sfe-uart-to-rs-485-converter.html
The following is the pin configuration.
RS-485-- 5v pin to 5v pin on X2, GND to GND, RX on 485 to TX on X2, TX on 485 to RX on X2.
Lidar— 5v pin to 5von X2, GND to GND, RX on lidar to A on RS-485, TX on lidar to B on RS-485.
The following is the code for that,
#include <pololu/orangutan.h>
int main()
{
char data_receive[32];
unsigned char data_receive_position=0;
serial_set_baud_rate(UART0,9600);
serial_receive_ring(UART0, data_receive,sizeof(data_receive));
while(1)
{
while(serial_get_received_bytes(UART0) != data_receive_position)
{
if( data_receive_position == sizeof(data_receive_position)-1 )
{
data_receive_position=0;
}
else
{
data_receive_position++;
}
lcd_goto_xy(0,0);
print("received_byte= ");
print_unsigned_long(data_receive[data_receive_position]);
}
}
}
The thing is I’m not seeing any output on LCD.
Any thing regarding this issue will help me a lot.