![]() ![]() ![]() We start off by including the liquidcrystal_i2c.h library to access the functions to control the I2C LCD.Īfter setting the cursor, we print the string “STM32 BLUE PILL” using the function HD44780_PrintStr(). #include "main.h"įor(int counter=0 counter<= 10 counter++) Inside the main.c file, make sure the following code is part of your script by including the lines of code given below. Now let us look at our main.c file that was generated. We will use I2C LCD library functions to display text and numbers on the I2C LCD, both in a static manner and a scrolling manner. STM32 Blue Pill I2C LCD STM32CubeIDE Code Change line 58 to #define DEVICE_ADDR (0x27 Src and create a new file called ‘ liquidcrystal_i2c.c‘ Copy the following code from this link and save it to this file.Change line 4 to #include “stm32f1xx_hal.h”.16X2 LCD without I2C circuit has sixteen pins. ![]() The LCD has the usual type of hd44780 controller, and it also has an I2C circuit connected with it which makes it easy to connect to the STM board. The characters are alphanumeric, but you can create custom characters for basic graphics, bar graphs that kind of thing. The I2C LCD is a 16×2 device which means it can display 16 columns by two rows of characters.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |