12.8.1.1.2 Code
Copy-paste the following setup code to your user application:
Add to user application initialization (typically the start of main()):void
config_port_pins(
void
)
{
struct
port_config pin_conf;
port_get_config_defaults(&pin_conf);
pin_conf.direction = PORT_PIN_DIR_INPUT;
pin_conf.input_pull = PORT_PIN_PULL_UP;
port_pin_set_config(BUTTON_0_PIN, &pin_conf);
pin_conf.direction = PORT_PIN_DIR_OUTPUT;
port_pin_set_config(LED_0_PIN, &pin_conf);
}
config_port_pins();