本文整理汇总了C++中SimpleTimer::run方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleTimer::run方法的具体用法?C++ SimpleTimer::run怎么用?C++ SimpleTimer::run使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleTimer
的用法示例。
在下文中一共展示了SimpleTimer::run方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loop
// LOOP
void loop()
{
switch(currentState)
{
case menu:
MotorSpeed(LEFT_MOTOR, 0);
MotorSpeed(RIGHT_MOTOR, 0);
ShowMenu();
break;
case moveStraight:
Update();
ProcessMovementAnalog();
break;
case turnLeft:
case turnRight:
Turn();
break;
}
turnSignalTimer.run();
lapTimer.run();
}
示例2: loop
void loop() {
//Start timer, this is used to lift and lower the drill.
timer.run();
// send data only when you receive data:
if (Serial.available() > 0) {
// read the incoming byte:
incomingString = Serial.read();
// If incoming is "q"
if (incomingString == 101){
dirA = 'F';
dirB = 'F';
}
// If incoming is "e"
else if (incomingString == 113){
dirA = 'F';
dirB = 'R';
}
// If incoming is "w"
else if (incomingString == 119){
dirA = 'F';
dirB = 'N';
}
// If incoming is "z"
else if (incomingString == 99){
dirA = 'R';
dirB = 'F';
}
// If incoming is "c"
else if (incomingString == 122){
dirA = 'R';
dirB = 'R';
}
// If incoming is "x"
else if (incomingString == 120){
dirA = 'R';
dirB = 'N';
}
// If incoming is "a"
else if (incomingString == 100){
dirA = 'N';
dirB = 'F';
}
// If incoming is "d"
else if (incomingString == 97){
dirA = 'N';
dirB = 'R';
}
// If incoming is "s"
else if (incomingString == 115){
dirA = 'N';
dirB = 'N';
}
// If incoming is "r"
else if (incomingString == 114){
ResetCoords();
dirA = 'N';
dirB = 'N';
}
// If incoming is "f"
else if (incomingString == 102){
LiftDrill();
Serial.print("Drill is up");
Serial.print("\n");
dirA = 'N';
dirB = 'N';
}
// If incoming is "v"
else if (incomingString == 118){
LowerDrill();
Serial.print("Drill is down");
Serial.print("\n");
dirA = 'N';
dirB = 'N';
}
//Calculate steps according to selected direction and last step
Step(dirA, dirB);
//Write data to ShiftRegister
WriteData(Output);
//Write coordinates to LCD
outgoingString = "";
outgoingString = outgoingString + "X: ";
outgoingString = outgoingString + CoordX;
outgoingString = outgoingString + " Y: ";
outgoingString = outgoingString + CoordY;
//Write coordintes to Serial port
Serial.print("Position");
Serial.print(outgoingString);
Serial.print("\n");
Serial.print("\n");
}
// LCD Part of code
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
//.........这里部分代码省略.........
示例4: loop
void loop()
{
Blynk.run();
timer.run();
}
示例5: timerRun
void timerRun(void){
timer.run(); // Keep the timer running
}