#include "Energia.h"
volatile int state=HIGH;
void setup()
{
// put your setup code here, to run once:
pinMode( RED_LED ,OUTPUT); // set P1_0 output
TA1CTL = TASSEL_1+TACLR+ MC_2+TAIE;
}
void loop()
{
// put your main code here, to run repeatedly:
digitalWrite( RED_LED, state); //ser P4_1 high
}
// Timer interrupt service routine
__attribute__((interrupt(TIMER1_A0_VECTOR)))
void Timer_A_int(void)
{
digitalWrite( RED_LED, LOW); //ser P4_1 high
}
此帖出自
小平头技术问答
一周热门 更多>