HalLedBlink(P0_6, 0, 50, 500);
这个算法主要的作用就是闪烁,但是第一个参数应该如何设置,我们想利用这个参数设置P0_6端口控制的灯一闪一闪的。
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 HalLedBlink (uint8 leds, uint8 numBlinks, uint8 percent, uint16 period)
/***************************************************************************************************
* @fn HalLedBlink
* @brief Blink the leds
* @param leds - bit mask value of leds to be blinked
* numBlinks - number of blinks
* percent - the percentage in each period where the led will be on
* period - length of each cycle in milliseconds
* @return None
***************************************************************************************************/
您还需要在hal_board_cfg.h 文件内设置IO口,如下所示
/* 3 - Yellow */
#define LED3_BV BV(7)
#define LED3_SBIT P1_7
#define LED3_DDR P1DIR
#define LED3_POLARITY ACTIVE_HIGH