本文整理汇总了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;
}
示例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();
}
示例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
}