Button

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Button

678 Views
Filip523
Contributor I

Hello, i am trying to find way. To define button for switching off and on leds. On board KL27z.
Here is what i am trying to do in the function:
GPIO_ClearPinsOutput(GPIOE, 1<<20u);
GPIO_SetPinsOutput(GPIOC, 1<<0u);
GPIO_SetPinsOutput(GPIOE, 1<<31u);
delay(5000000);
GPIO_ClearPinsOutput(GPIOC, 1<<0u);
GPIO_ClearPinsOutput(GPIOE, 1<<31u);
GPIO_SetPinsOutput(GPIOE, 1<<20u);

But i cant find a way how to use the button connected on PTE21.
Can anyone help me ? 
Thanks 
Filip

0 Kudos
1 Reply

664 Views
nxf58474
NXP Employee
NXP Employee

Hello Filip,

 

Hope you are doing well. I would recommend that you refer to the gpio_input_interrupt SDK example. You can download the SDK from this page: SDK Builder.

After downloading the SDK, you need to drag and drop the SDK into the "Installed SDK's view" in MCUXpresso.

To import and example, you must click "Import SDK example(s)…", Select the frdmkl27z, and click next:

nxf58474_3-1607701593594.png

 

Then you need to select the example: driver_examples>gpio>gpio_input_iunterrupt:

nxf58474_2-1607701584718.png

 

Hope this helps.

 

Best Regards,

Ricardo

0 Kudos