当前位置: 首页>>代码示例>>C++>>正文


C++ SimpleTimer::run方法代码示例

本文整理汇总了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();
}
开发者ID:johndharvey,项目名称:Robert-roving-robot,代码行数:24,代码来源:Wire+following+PID+control.cpp

示例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);
//.........这里部分代码省略.........
开发者ID:Zokol,项目名称:ArduinoCNC,代码行数:101,代码来源:cnc.c

示例3: loop

void loop()
{
	timer.run();
}
开发者ID:cybertux,项目名称:theseus,代码行数:4,代码来源:shutter.cpp

示例4: loop

void loop()
{
	Blynk.run();
	timer.run();
}
开发者ID:andyalexander,项目名称:ReflowController,代码行数:5,代码来源:Main.cpp

示例5: timerRun

void timerRun(void){
  timer.run();									// Keep the timer running
}
开发者ID:ksuhartono97,项目名称:ENGG1200-Airship-Group-6,代码行数:3,代码来源:BT_timer.cpp


注:本文中的SimpleTimer::run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。