You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
567 B

#include "TeensyTimerTool.h"
using namespace TeensyTimerTool;
void callback(int& someInt, int cnt) // this callback has context, i.e. parameter
{
for (int i = 0; i < cnt; i++) // when called, print out someInt cnt times
{
Serial.print(someInt);
Serial.print(" | ");
}
Serial.println();
}
//==============================================================
PeriodicTimer t;
int number = 0;
void setup()
{
t.begin([] { callback(number, 5); }, 50ms);
}
void loop()
{
number++; // change every second
delay(1000);
}