Continue to study the official routines. This time, I use the I2C_LCD example. For the opening method of the routine, please refer to the steps of opening the PWM routine before. Because there is only LCD1602 at hand and there is no I2C interface, I changed it to LCD1602 in this routine. According to the basic configuration circuit of LCD1602, I made a small adapter board for easy wiring, as shown below.
The 3rd pin VO is used to adjust the brightness of the font. I found a 330 ohm resistor. The size depends on the specific LCD. It is best to connect an adjustable resistor. In addition, the pin header should be soldered on the PSoC4100 board for connecting LCD1602. Open the routine, add a Character_LCD module, and rename it LCD_1602.
Let's modify the main function: int main(void) { CyGlobalIntEnable; LCD_1602_Start(); LCD_1602_Position(0,0); LCD_1602_PrintString("PSOC4100 LCD1602"); LCD_1602_Position(1,0); LCD_1602_PrintString("hello eeworld ! "); for(;;) {} } The final effect is as follows: