通过pin_open是否可以点亮LED灯?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
给你一段代码看看。
void led_init()
{
PIN_State ledPinState;
PIN_Config ledPinTable[] = {
Board_PIN_LED0 | PIN_GPIO_OUTPUT_EN | PIN_GPIO_LOW | PIN_PUSHPULL | PIN_DRVSTR_MAX,
PIN_TERMINATE
};
ledPinHandle = PIN_open(&ledPinState, ledPinTable);
PIN_setOutputValue(ledPinHandle, Board_PIN_LED0, CC1310_LAUNCHXL_GPIO_LED_ON);
}
void led_on()
{
PIN_setOutputValue(ledPinHandle, Board_PIN_LED0, Board_LED_ON);
}
void led_off()
{
PIN_setOutputValue(ledPinHandle, Board_PIN_LED0, Board_LED_OFF);
}
void led_reverse()
{
PIN_setOutputValue(ledPinHandle, Board_PIN_LED0,!PIN_getOutputValue(Board_PIN_LED0));
}
void led_close()
{
PIN_close(ledPinHandle);
}