Character LCD Demo 2 lines
demo File: clcd_demo.mdl
From above demo model, LCD line1 will display sample time index. LCD line2 will display analog reading value (0-3.3V).
1. "Target Setup" block, this block is needed for STM32F4 target. Select the right MCU part, compiler, automatic compile & download and more. This demo use sample time is 1ms.
2. "Character LCD Setup" block. This block located in LCD Setup subsystem, for configure MCU pin to control LCD display.
3. "Volatile Data Storage" and "Volatile Data Storage1" blocks are configured as string buffer, storing string/ message for LCD line2 and line1 respectively.
3. "Character LCD Write" block use for write LCD line with string/ message from buffer (Volatile Data storage1).
4. "Character LCD Write1" block use for write LCD line with string/ message from "Volatile Data Storage" block.
5. "printf2" block, generate formatted string: Index: %u and store into "Volatile Data Storage1" block. %u will be replaced with unsigned int32 value from counter free running block.
6. "printf" block, generate formatted string: Value: %1.3f V and store into "Volatile Data Storage" block. %1.3f will replaced with single value from ADC module.
Build this demo model into target board (STM32F4 board).
1. Update model, by click "Update diagram" on tool bar or press Cntrl + D keys to update the sample time of blocks. You may need to update diagram two times to make sample time showing correctly.
2. Build model into target board. By click icon "Incremental build" on toolbar or press Cntrl + B then wait until Auto compile & Download finish.