Digital Communication

Many devices and sensors require you to use digital communication to use them.  Examples would be keyboards, mice, displays, and accelerometers.

There are several types of digital communication you will likely use with your Arduino: Serial, SPI, I2C, and PWM.

Serial communication is what your board uses for communication with your computer.  If you look at your board, you will notice an RX (receiving line, pin 0) and a TX (transmitting line, pin 1).

SPI (serial peripheral interface) is common form of communication with top end devices. These use 4 wires (plus ground and power).  They are MOSI (Master Out Slave In, pin 11), MISO (Master In, Slave Out, pin 12) SCLK (Serial CLocK, pin 13), and SS (Serial Select, pin 10).  When the SS pin is LOW, the device will be expecting data to start flowing, when the SS pin is set to HIGH, the chip will ignore any data.

I2C is a great method of communication because it requires only two pins and is asynchronous (doesn't need a clock).  I2C uses two pins on the Uno: SDA (DAta line, pin 4) and SCL (CLock, pin 5).  If you ever need to read AND write using this method, know that you'll have to configure it each time.

PWM is rare for communication, but very useful.  A major use is to control servos.

More information as we cover this topic in the workshops.