Forum Rule: Always post complete source code & details to reproduce any issue!
-
TOF mini Lidar
We tested with Arduino it worked very well when i use with with teensy 3.5 ,it is not working sample codes.
http://wiki.seeed.cc/Grove-TF_Mini_LiDAR/
unsigned char dta[100];
unsigned char len = 0;
void setup()
{
Serial1.begin(115200);
Serial.begin(115200);
}
void loop()
{
while(Serial1.available()>=9)
{
if((0x59 == Serial1.read()) && (0x59 == Serial1.read())) //Byte1 & Byte2
{
unsigned int t1 = Serial1.read(); //Byte3
unsigned int t2 = Serial1.read(); //Byte4
t2 <<= 8;
t2 += t1;
Serial.print(t2);
Serial.print('\t');
t1 = Serial1.read(); //Byte5
t2 = Serial1.read(); //Byte6
t2 <<= 8;
t2 += t1;
Serial.println(t2);
for(int i=0; i<3; i++)
{
Serial1.read(); ////Byte7,8,9
}
}
}
}
Anyone used before ?
-
Senior Member+
"Doesn't work" is of no value, as long as you don't say what does not work. Do you get compiler warnings or errors? To which Teensy pins did you connect the LIDAR exactly ?
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules