Read Serial and Log CSV
Write a Python script to read lines from a serial port and log them into CSV format. Handle serial exceptions and close file safely.
Constraints
- Use pyserial.
- Com port and baud via args.
- Write 'timestamp,value' format.
- Ctrl+C exits cleanly.
1import serial, time2# TODO