


In the setup function, the baud rate is also set to 9600 which must match to the baud rate of the Arduino Uno. The buff variables stores the incoming values via UART and the indx variable stores the index of the 8 bit. To identify the Hex address of your I2C device you find a Hex address scanner in this article. We initialize the 20×4 LCD display on HEX address 0x27.

The second library Wire has to be included to enable the I2C communication between the NodeMCU and the LCD display. In addition to the full-duplex communication, there are two more communication forms which only need 1 shift register:įirst we have to include the LiquidCrystal_I2C library to make the communication to the LCD display easier. In comparison in SPI communication, master and slave only need 1 shift register for the receiving signals because due to the synchronous data transfer the shift register is emptied and filled at the same time and because the size of the shift register is the same for all devices the data transfer starts and finished at the same time. This is necessary because a device could receive a new data byte while still sending a data byte. If master and slave device send and receive data at the same time, called full-duplex communication, each device need 2 shift registers to store the transmitting and receiving characters. Therefore there are always 1 master and 1 slave device.īecause the data transfer is asynchronous, UART does not need a clock signal to synchronize data transfer and data can be send and received in different timings. The mayor drawback of UART is that no multiple master and no multiple slave communication are supported. The transferred data is grouped in packages / messages, made of a header and a payloadĭata is transferred bit by bit along a single wire You can connect multiple salves to a single master

You can have multiple masters controlling one or multiple slaves Instead of a clock signal the data steam itself contain start and stop signals 1960 by Gordon Bell at Digital Equipment CorporationĪ clock line is required to synchronize the communication
