Recall & Review
beginner
What is baud rate in serial communication?
Baud rate is the speed at which data is sent over a serial connection. It tells how many bits are transmitted per second.
Click to reveal answer
beginner
Why do we set a timeout when reading from a serial port?
Timeout tells the program how long to wait for data before giving up. It helps avoid waiting forever if no data comes.
Click to reveal answer
intermediate
How do you set baud rate and timeout in Python's serial library on Raspberry Pi?
You set baud rate and timeout when creating the serial.Serial object, like: serial.Serial('/dev/ttyUSB0', baudrate=9600, timeout=1)
Click to reveal answer
beginner
What happens if the baud rate is set incorrectly?
If baud rate is wrong, data will be garbled or lost because sender and receiver are not synchronized in speed.
Click to reveal answer
intermediate
Explain the difference between blocking and non-blocking read with timeout.
Blocking read waits until data arrives or timeout expires. Non-blocking read returns immediately if no data is available.
Click to reveal answer
What does a baud rate of 9600 mean?
✗ Incorrect
Baud rate measures bits per second, so 9600 means 9600 bits are sent each second.
What is the purpose of setting a timeout in serial communication?
✗ Incorrect
Timeout limits waiting time for data, preventing the program from hanging forever.
Which Python library is commonly used for serial communication on Raspberry Pi?
✗ Incorrect
The 'serial' library (pyserial) is used to handle serial ports.
What happens if the baud rate of sender and receiver do not match?
✗ Incorrect
Mismatch in baud rate causes data errors because devices are not synchronized.
If timeout is set to 0 in serial read, what does it mean?
✗ Incorrect
Timeout 0 means the read call returns immediately without waiting for data.
Describe how to configure baud rate and timeout for serial communication on a Raspberry Pi using Python.
Think about how you open a serial port with settings.
You got /4 concepts.
Explain why setting the correct baud rate and timeout is important in serial communication.
Consider what happens if speeds don't match or program waits too long.
You got /4 concepts.
