STM32M4clicker LED & BUTTON by NECTO STUDIO Example

General discussion on mikroElektronika development boards.
Post Reply
Author
Message
shpark@craeca.com
Posts: 1
Joined: 18 Dec 2023 09:04

STM32M4clicker LED & BUTTON by NECTO STUDIO Example

#1 Post by shpark@craeca.com » 22 Dec 2023 08:32

Dear Linux-Mikroe-Devboard Users,

Wanna use the LED and BUTTON of STM32M4clicker.
STM32M4clicker_LED_BUTTON.png
STM32M4clicker_LED_BUTTON.png (19.45 KiB) Viewed 292 times
So, in the example, I searched for LED and then searched for the defined item, but I couldn't find any instructions on how to use it. I'm curious how to toggle the LED and receive button input.

Regards.

User avatar
IvanJeremic
mikroElektronika team
Posts: 316
Joined: 05 Sep 2022 14:32

Re: STM32M4clicker LED & BUTTON by NECTO STUDIO Example

#2 Post by IvanJeremic » 25 Dec 2023 11:10

Hi,

You can use the #include "drv_digital_in.h" library in order to use these buttons.

You will need to set the variable, lets say for PC0 pin:
static digital_in_t input_pin_C0;

Initialize:

digital_in_init( &input_pin_C0, PC0 );

And then use it for example like below:
value = digital_in_read( &input_pin_C0 );
if(value == 1)
{
......
}

Regards,

Ivan.

User avatar
Tanja_Kovacevic
mikroElektronika team
Posts: 98
Joined: 09 Aug 2021 11:39

Re: STM32M4clicker LED & BUTTON by NECTO STUDIO Example

#3 Post by Tanja_Kovacevic » 09 Jan 2024 18:22

Hi,

You can open driver header files and see the necessary functions with examples in doxy explanations (left in the image below).
Or you can type the "digital_out" or "digital_in" in a field for asking questions (right at the attached image).

Screenshot1.jpg
Screenshot1.jpg (289.5 KiB) Viewed 195 times

Kind regards,
Tanja

Post Reply

Return to “Development Boards”