Code:
import machineimport time# Define serial portuart = machine.UART(0, baudrate=115200, tx=0, rx=1, timeout=1000)# Main functiondef main(): while True: try: radar_data = uart.read(22) if radar_data is None: raise ValueError("No data received from radar.") if len(radar_data) == 22: print("Received data packet(HEX):", " ".join(['{:02X}'.format(byte) for byte in radar_data])) print("Length of received data packet:", len(radar_data)) except Exception as e: print("Exception:", e) # Attempt to reset the radar module reset_radar()if __name__ == "__main__": main()
RX of TTL side to RX of pico
I have connected the TX of TTL side to TX of picoI have connected the TX of TTL side to TX of pico
RX of TTL side to RX of picoRX of TTL side to RX of pico
Statistics: Posted by vsdevatkal — Sat Jun 15, 2024 6:59 am