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


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

本文整理汇总了C++中SimpleTimer::disable方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleTimer::disable方法的具体用法?C++ SimpleTimer::disable怎么用?C++ SimpleTimer::disable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleTimer的用法示例。


在下文中一共展示了SimpleTimer::disable方法的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;
}
开发者ID:johndharvey,项目名称:Robert-roving-robot,代码行数:43,代码来源:Wire+following+PID+control.cpp

示例2: Update

// Updates the sensors and machine state
void Update()
{
    if ((lcdRefreshCount == 0) && (currentState != menu) && (ReadButton() == SELECT))
    {
        delay(750);
        if(ReadButton() == SELECT) // debounce MENU button
        {
            // Stop motors before entering menu
            MotorSpeed(LEFT_MOTOR, 0);
            MotorSpeed(RIGHT_MOTOR, 0);

            Clear();
            Cursor(TOP, 0);
            Print("Entering menu");
            currentState = menu;
            delay(1000);
            lapTimer.disable(0);
            return;
        }
    }

    // Read raw sensor values
    left = analogRead(LEFT_SENSOR);
    right = analogRead(RIGHT_SENSOR);
    leftDetected = left > thresholdLeft.Value;
    rightDetected = right > thresholdRight.Value;
    if (leftDetected || rightDetected)
    {
        CenterSmartUpdate();
    }

    // Display values on LCD
    lcdRefreshCount = (lcdRefreshCount <= 0) ? lcdRefreshPeriod : (lcdRefreshCount - 1);
    batteryCount = (batteryCount <= 0) ? batteryPeriod : (batteryCount - 1);
    DisplaySensorValues();   
}
开发者ID:johndharvey,项目名称:Robert-roving-robot,代码行数:37,代码来源:Wire+following+PID+control.cpp

示例3: timer_init

// Function to protect bluetooth disconnection
void timer_init(void){
  BT_timer_id = timer.setTimeout(1000, terminate);  // Stop all the motors in two seconds after bluetooth is disconnected, setTimeout function will return the ID of the timer.
  timer.disable(BT_timer_id);                       // Disable to timer before connected to Android phone
}
开发者ID:ksuhartono97,项目名称:ENGG1200-Airship-Group-6,代码行数:5,代码来源:BT_timer.cpp


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