Read Serial Data and Log
Write a Python script that reads lines from a serial port and logs them to a file.
Constraints
- Use pyserial.
- Log destination: log.txt.
- Append mode only.
- Stop after 3 lines.
- Print each line read.
1import serial2 3# TODO
Write a Python script that reads lines from a serial port and logs them to a file.
1import serial2 3# TODO