This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:iot-open:practical:hardware:sut:stm32:emb5_1 [2024/04/10 20:02] – ktokarz | en:iot-open:practical:hardware:sut:stm32:emb5_1 [2024/04/10 20:20] (current) – [Steps] ktokarz | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| You are going to use a library to handle the LCD. It means you need to add it to your '' | You are going to use a library to handle the LCD. It means you need to add it to your '' | ||
| <code bash> | <code bash> | ||
| - | lib_deps = adafruit/Adafruit | + | lib_deps = arduino-libraries/ |
| </ | </ | ||
| Line 36: | Line 36: | ||
| Declare GPIOs controlling the LCD, according to the hardware reference: | Declare GPIOs controlling the LCD, according to the hardware reference: | ||
| <code c> | <code c> | ||
| - | #define LCD_RS 2 | + | const int rs = PC5, en = PB11, d4 = PB12, d5 = PB13, d6 = PB14, d7 = PB15; |
| - | #define LCD_ENABLE 1 | + | |
| - | #define LCD_D4 39 | + | |
| - | #define LCD_D5 40 | + | |
| - | #define LCD_D6 41 | + | |
| - | #define LCD_D7 42 | + | |
| </ | </ | ||
| === Step 3 === | === Step 3 === | ||
| - | Declare | + | Declare |
| <code c> | <code c> | ||
| - | static Adafruit_LiquidCrystal | + | LiquidCrystal |
| </ | </ | ||
| Line 53: | Line 48: | ||
| Initialise class with display area configuration (number of columns, here 16 and rows, here 2): | Initialise class with display area configuration (number of columns, here 16 and rows, here 2): | ||
| <code c> | <code c> | ||
| - | lcd.begin(16, | + | lcd.begin(16, |
| </ | </ | ||
| Line 61: | Line 56: | ||
| * '' | * '' | ||
| * '' | * '' | ||
| + | |||
| + | A simple example can be the Hello World: | ||
| + | <code c> | ||
| + | lcd.print(" | ||
| + | </ | ||
| ==== Result validation ==== | ==== Result validation ==== | ||