[MSC121x EVM]- 타이머 제어 예제
MSC1210 *1초마다 LED를 깜박이는 예제
//-----------------------------------------------------------------------------
// Main Funiction
//-----------------------------------------------------------------------------
void main(void)
{
int led_flash = TRUE;
//Initialize CPU
SystemInit();
//Timer0 Initialize
InitTimer0();
enable();
while(1)
{
if(led_flash)
{
//50x100 = 500ms
if(m_TimeTick50ms>100)
{
Led1Toggle();
m_TimeTick50ms = 0;
}
}
}
}
//-----------------------------------------------------------------------------
반응형