#3 Blinky External LED
In [Freescale K20D50M MCU Programming] #2 Blinky Red LED onboard, We tried blinky with onboard LED. Lets try out blinking the external LED connected to a GPIO pin.. We are going to use Codewarrior and processorexpert with FRDM-K20D50M board
Take a look at the [Freescale K20D50M MCU Programming] #1 Helloworld on the Console using Processor Expert for quickstart
Lets get started.
First we need to see the schematic to identify the GPIO pin for our external LED. There is a good youtube video which gives an example on K25Z board.
and the pin connectivity as below
Now Lets create a new project as mentioned in [Freescale K20D50M MCU Programming] #2 Blinky Red LED onboard we add a BITIO_LDD Component
And setting the properties to PTD0
I have added a WAIT custom component from processor expert to show a delay
And add this code in main.c
gpio_led_NegVal(NULL);
WAIT1_Waitms(1000);
gpio_led_NegVal(NULL);
And you see the external LED Blinking.
No comments:
Post a Comment