📄 blink_b.c
字号:
#include <type.h>
#include <board.h>
/*****************************************************************************/
/* Function Prototypes */
/*****************************************************************************/
void myBlink(void); /* Periodic blink function */
/*****************************************************************************/
/* Global Variables */
/*****************************************************************************/
int currentLed; /* LED to be toggled next */
/*****************************************************************************/
/* void main(void) - MAIN */
/* */
/* This functions initializes the "currentLed" variable. */
/*****************************************************************************/
void main(void)
{
currentLed = BRD_LED0; /* set LED to be toggled to LED 0 */
return;
}
/*****************************************************************************/
/* void myBlink(void) - Periodic Blink Function */
/* */
/* This function toggles one of the 3 board LED's based on the value of the */
/* "currentLed" variable. It is performed at a 750ms rate. */
/*****************************************************************************/
void myBlink(void)
{
switch(currentLed)
{
case BRD_LED0: brd_led_toggle(BRD_LED0);
currentLed = BRD_LED1;
break;
case BRD_LED1: brd_led_toggle(BRD_LED1);
currentLed = BRD_LED2;
break;
case BRD_LED2: brd_led_toggle(BRD_LED2);
currentLed = BRD_LED0;
break;
default: return;
}
return;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -