ВОт так
PHP код:
//Выполнение процедуры по прерыванию таймеру.
#include <MsTimer2.h>
static boolean output = HIGH;
void flash_led() //обработчик прерывания
{
digitalWrite(13, (output==HIGH) ? output=LOW : output=HIGH);
}
void setup() {
pinMode(13, HIGH);
MsTimer2::set(500, flash_led); // 500ms период
MsTimer2::start(); //включить таймер
}
void loop()
{
//.....
}