Aug-03-2023, 07:59 PM
So i bought my python programmable Lidar Chip and havent recieved data yet because after opening it up in pyserial i have no idea how to test it...
so i built serial tester code.
with what i have deciphered from the users manual........
serialtest.py
this is what i am receiving...
so i built serial tester code.
with what i have deciphered from the users manual........
serialtest.py
#!/usr/bin/env python import serial import time serious = serial.Serial('/dev/ttyUSB0',921600,timeout=.1) print ('serial port name: '+str(serious.name)) startCMDchar = b'0b10101010101010101010101010101010' deviceaddress = b'00000000' cmdcodestart = b'0b10' cmdcodestop = b'0b1111' cmdcodeok = b'0b10010' cmdstart = b'0b10101010101010101010101010101010000000000b10' cmdstop = b'0b10101010101010101010101010101010000000000b1111' cmdok = b'0b10101010101010101010101010101010000000000b10010' serious.flush() serious.write(cmdok) counter = serious.in_waiting print (counter) answer = serious.read(counter) print (answer) serious.flush() serious.write(cmdstart) counter2 = serious.in_waiting answer2 = serious.read(counter) print (counter2) print (answer2) serious.write(cmdstop)I must be way off .....
this is what i am receiving...