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
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:
Then you need to select the example: driver_examples>gpio>gpio_input_iunterrupt:
Hope this helps.
Best Regards,
Ricardo