Lecture 6

Cards (12)

  • what does serial communication involve
    sending a series of digital pulses back and forth between devices at a mutually agreed-upon rate. The sender sends pulses representing data at the rate, while the receiver listens for pulses at the same rate.
  • what does serial mean
    one after the other
  • what is serial data transfer

    when we transfer data one bit at a time, one right after the other.
  • how does the arduino board use serial communication
    for communication between the arduino and a computer or other devices. This happens via the board's USB connection and digital pins 0(RX) and 1 (TX). So, if you use these functions, you cannot use pins 0 and 1 for digital i/o.
  • what is a protocol, in regards to serial communication

    the set of parameters the two devices agree upon in order to send information.
    There are many different protocols for serial communication, each suited to different applications
  • what does a protocol involve
    • physical connection (serial port)
    • timing (speed)
    • electrical connection (voltage level)
    • package size (bits per package)
  • what is the most frequently used timing?
    9600 pulses per second (9600 bits per second)
  • since a bits are sent between devices in groups of 8 (a byte), what numbers can you send
    0-255
  • what does Serial.read() read and what does it return
    reads incoming serial data
    returns an int which is the first byte of incoming serial data or -1 if no data
  • what does Serial.available() return
    the number of bytes (characters) available for reading from the serial port.
    This is the data that has already arrived and is stored in the serial receive buffer (holds 64 bytes).
  • what does Serial.print() do
    prints data to the serial port as human-readable ASCII text.
    This can take form as:
    • numbers printed using an ASCII char for each digit
    • floats similarly printed as ASCII digits, defaulting to two decimal places
    • bytes sent as a single character
    • characters and strings sent as is
  • what does Serial.write() take as input and output
    it can take a value (integer) to send as a single byte, a string to send as a series of bytes, or an buffer/array to send as a series of bytes along with an integer length of the the buffer/array
    it writes binary data to the serial port