我正在做一个房间可视化项目,类似于这个(取自这个视频):
我使用来自 leddartech 的 LeddarVu8(见下图),arduino uno(带有 rs485shield):
我还使用了 simple16channel 的 leddartech 提供的代码(无 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 的串行监视器只输出一系列?????
. 这是为什么?