Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <project.h>
- /* The LCD format in characters */
- #define LCD_ROWS (2u)
- #define LCD_COLUMNS (16u)
- /* The delay between displaying bar graphs */
- #define BARGRAPH_DELAY_MS (15u)
- int main()
- {
- uint8 row = 0u;
- uint8 column = 0u;
- uint8 length = 0u;
- /* Start the LCD */
- LCD_Start();
- /* Show the demo start message */
- LCD_Position(0u, 0u);
- LCD_PrintString("Horizontal BG");
- LCD_Position(1u, 0u);
- LCD_PrintString("Demo started");
- CyDelay(1000u);
- /* Clear the LCD display */
- LCD_ClearDisplay();
- /* Display the bar graph in each row of the LCD */
- for(row = 0u; row < LCD_ROWS; row++)
- {
- /* Display the bar graph from left to right with moving towards right */
- for(column = 0u; column <= LCD_COLUMNS; column++)
- {
- for(length = 0u; length < (LCD_CHARACTER_WIDTH * (LCD_COLUMNS - column)); length++)
- {
- LCD_DrawHorizontalBG(row, column, LCD_COLUMNS - column, length);
- CyDelay(BARGRAPH_DELAY_MS);
- }
- /* Clear the display */
- LCD_ClearDisplay();
- }
- }
- /* Wait for some time */
- CyDelay(500u);
- /* Show the demo completion message */
- LCD_Position(0u, 0u);
- LCD_PrintString("Horizontal BG");
- LCD_Position(1u, 0u);
- LCD_PrintString("Demo completed");
- for(;;)
- {
- }
- }
- /* [] END OF FILE */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement