The ADXL345 is a complete 3-axis acceleration measurement system with a selectable measurement range of ±2 g, ±4 g, ±8 g, or ±16 g. It measures both dynamic acceleration resulting from motion or shock and static acceleration, such as gravity, which allows the device to be used as a tilt sensor. In this tutorial we are going to interface ADXL345 with STM32.
connect the first pin of the PCF8574 to the VSS of the LCD, 2nd pin to the VCC and so on. The input pins of the PCF8574 i.e. SCL and SDA should be connected with the SCL and SDA of the microcontroller.
So here I am starting I2C tutorial in STM32. I know it's early because we still need to go through some basic things before jumping to I2C but the problem is LCD. It takes a whole lot of efforts to interface LCD using conventional methods, but by using I2C, we can do it really easy. I will cover other ways to interface LCD later in upcoming tutorials. Before using I2C to interface LCD, let's first write a simple code to know about I2C functions.