#include
// Timer 0 overflow interrupt service routine
unsigned int x,m_1;
interrupt [TIM0_OVF] void timer0_ovf_isr(void)
{
// Place your code here
x++;
if(x==938) {
x=0; }
else
{
if (x <= m_1) { PORTB.1=1; }
else
{ PORTB.1=0; }
}
}
while
(1)
{
// Place your code here
m_1=46;
delay_ms(500);
m_1=94;
delay_ms(500);
};
}
Jadi...