【发布时间】:2018-01-10 23:37:13
【问题描述】:
我正在做一个与此类似的房间可视化项目(取自this video):
我使用的是 leddartech 的 LeddarVu8(见下图),arduino uno(带有 rs485shield):
我也使用了 leddartech 提供的 simple16channel (no lcd) 的代码:
#include "C:\Program Files (x86)\Arduino\libraries\Leddar.h"
/*
Simple Leddar(TM) Example - Without LCD
Language: Arduino
This program lists the detections read on the serial port of the Arduino.
Can be used with Arduino IDE's Serial Monitor.
Shields used:
* RS-485 Shield
Created 01 Jun. 2015
by Pier-Olivier Hamel
This example code is in the public domain.
*/
Leddar16 Leddar1(115200,1);
//Baudrate = 115200
//Modbus slave ID = 01
void setup()
{
//Initialize Leddar
Leddar1.init();
}
void loop()
{
char result = Leddar1.getDetections();
if (result >= 0)
{
for (int i = 0; i < Leddar1.NbDet; i++)
{
Serial.print("Segment: ");
Serial.print(Leddar1.Detections[i].Segment);
Serial.print(" Distance: ");
Serial.print(Leddar1.Detections[i].Distance);
Serial.print("\n");
}
}
else
{
Serial.print("Error: ");
Serial.print((int)result);
Serial.print("\n");
}
delay(50);
}
(来自https://support.leddartech.com/downloads/files/89-leddarsdk3-2-0-pi2-tar-gz)
问题是arduino的串口监视器只输出一系列?????。这是为什么呢?
【问题讨论】:
标签: arduino-uno lidar