本文整理汇总了C++中SimpleTimer::setInterval方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleTimer::setInterval方法的具体用法?C++ SimpleTimer::setInterval怎么用?C++ SimpleTimer::setInterval使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleTimer
的用法示例。
在下文中一共展示了SimpleTimer::setInterval方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setup
// SETUP
void setup()
{
// For algorithm speed checking
loopPeriod = 0;
lastLoop = micros();
// Lap timer
lapTimer.setInterval(100, IncrementTime);
lapTimer.disable(0);
// Initialize LCD
lcd.begin(16, 2);
lcd.setCursor(0,0);
// Turn signals
pinMode(LEFT_TURN_LED, OUTPUT);
pinMode(RIGHT_TURN_LED, OUTPUT);
digitalWrite(LEFT_TURN_LED, 0);
digitalWrite(RIGHT_TURN_LED, 0);
turnSignalTimer.setInterval(50, TurnSignal);
// Force motors off by default
MotorSpeed(LEFT_MOTOR, 0);
MotorSpeed(RIGHT_MOTOR, 0);
// Parameters need to be loaded from EEPROM
LoadFromEEPROM();
// Intro text
Clear();
Cursor(TOP, 0);
Print("FAST ORANGE");
Cursor(BOTTOM, 0);
#ifdef DEBUG_MODE
Print("Debug Mode");
#else
Print("Race Mode");
#endif
delay(1000);
currentState = menu;
}
示例2: setup
void setup()
{
Serial.begin(9600);
pinMode (11,OUTPUT);
pinMode (12,OUTPUT);
pinMode(8, INPUT); // Set the switch pin as input
pinMode(9, INPUT); // Set the switch pin as input
pinMode(10, INPUT); // Set the switch pin as input
// Pin 13 has an LED connected on most Arduino boards
pinMode(13, OUTPUT);
timer.setInterval(10,&debDown);
timer.setInterval(10,&debUp);
timer.setInterval(10,&debStop);
timer.setInterval(10000,&clockTimer);
mgr.moveUp();
}
示例3: setup
void setup()
{
Blynk.begin(AUTH, SSID, PASSWORD);
pinMode(heatPin, OUTPUT);
pinMode(tempPin, INPUT);
Serial.begin(9600);
Serial.println("\n\n\nTime, target, temp");
done = false;
RUNNING = false;
setHeater(LOW);
timerId = timer.setInterval(TIMESTEP * 1000L, setTemperature);
}