Skip to content

Commit

Permalink
Merge pull request #3 from MikroElektronika/improvement/lcd
Browse files Browse the repository at this point in the history
Updated LCD demo.
  • Loading branch information
StrahinjaJacimovic authored Dec 27, 2024
2 parents e6df981 + 64f598b commit 2ec9d82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 45 deletions.
41 changes: 0 additions & 41 deletions demos/sdk/demolcd/project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,47 +11,6 @@ add_executable(lcd_demo
main.c
)

if (${MCU_NAME} MATCHES "^STM32.+")
target_compile_definitions(lcd_demo PUBLIC
DELAY_LCD=400
)
endif()
if (${MCU_NAME} MATCHES "^MK.+")
target_compile_definitions(lcd_demo PUBLIC
DELAY_LCD=100
)
endif()
if (${MCU_NAME} MATCHES "^TM4.+")
target_compile_definitions(lcd_demo PUBLIC
DELAY_LCD=200
)
endif()
if (${MCU_NAME} MATCHES "^PIC32.+")
target_compile_definitions(lcd_demo PUBLIC
DELAY_LCD=200
)
endif()
if (${MCU_NAME} MATCHES "^PIC18.+")
target_compile_definitions(lcd_demo PUBLIC
DELAY_LCD=250
)
endif()
if (${CORE_NAME} MATCHES "DSPIC")
target_compile_definitions(lcd_demo PUBLIC
DELAY_LCD=400
)
endif()
if (${CORE_NAME} MATCHES "RISCV")
target_compile_definitions(lcd_demo PUBLIC
DELAY_LCD=100
)
endif()
if ((${CORE_NAME} MATCHES "GT64K") OR (${CORE_NAME} MATCHES "LTE64K"))
target_compile_definitions(lcd_demo PUBLIC
DELAY_LCD=200
)
endif()

find_package(MikroC.Core REQUIRED)
find_package(MikroSDK.Board REQUIRED)
find_package(MikroSDK.Driver.GPIO.Out REQUIRED)
Expand Down
8 changes: 4 additions & 4 deletions demos/sdk/demolcd/project/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

/**
* @brief For a detailed explanation of this demo, please visit:
* <https://libstock.mikroe.com/projects/view/5636/lcd-demo>
* <https://github.com/MikroElektronika/necto_demos/blob/main/demos/sdk/demolcd/project/README.md>
*/

// ------------------------------------------------------------------ INCLUDES
Expand Down Expand Up @@ -75,7 +75,7 @@
#error "SDK version must be 2.10.0 or higher."
#endif

#define LCD_DELAY_MOVE 300
#define DELAY_LCD 300

// ----------------------------------------------------------------- VARIABLES
static lcd_config_t lcd_cfg; // LCD config structure.
Expand Down Expand Up @@ -149,13 +149,13 @@ int main(void) {
// Shifting characters left 5 times.
for(i=0; i<5; i++) {
lcd_shift_left(lcd);
Delay_ms(LCD_DELAY_MOVE);
Delay_ms(DELAY_LCD);
}

// Shifting characters right 5 times.
for(i=0; i<5; i++) {
lcd_shift_right(lcd);
Delay_ms(LCD_DELAY_MOVE);
Delay_ms(DELAY_LCD);
}
}

Expand Down

0 comments on commit 2ec9d82

Please sign in to comment.