论坛» 嵌入式开发» MCU

当年调试LPC1343时使用的led闪烁程序

助工
2012-05-28 13:25 1楼

当年调试LPC1343时使用的led闪烁程序

#include "LPC13xx.h" /* LPC13xx definitions */
#include "clkconfig.h"
#include "gpio.h"
#include "config.h"
#include "timer32.h"
int main (void) {
init_timer32(0, TIME_INTERVAL);
enable_timer32(0);
GPIOInit();
GPIOSetDir( LED_PORT, LED_BIT, 1 );

while (1)
{
if ( (timer32_0_counter%LED_TOGGLE_TICKS) < (LED_TOGGLE_TICKS/2) )
{
GPIOSetValue( LED_PORT, LED_BIT, LED_OFF );
} else
{
GPIOSetValue( LED_PORT, LED_BIT, LED_ON );
}
__WFI();
}
}

共1条 1/1 1 跳转至

回复

匿名不能发帖!请先 [ 登陆 注册]