本文整理汇总了C++中SimpleTimer::setTimeout方法的典型用法代码示例。如果您正苦于以下问题:C++ SimpleTimer::setTimeout方法的具体用法?C++ SimpleTimer::setTimeout怎么用?C++ SimpleTimer::setTimeout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SimpleTimer
的用法示例。
在下文中一共展示了SimpleTimer::setTimeout方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: writeVal
boolean MyTone::writeVal( HardwareTypeIdentifier type, HardwareCommandResult* result ) {
if(type == HWType_tone && result != NULL && result->getUint16ListNum() > 0) {
uint16_t length = result->getUint16List()[0];
uint8_t tone = this->myTone;
if(result->getUint16ListNum() > 1)
tone = result->getUint16List()[1];
write(tone);
int num = timer.setTimeout(length, (timer_callback) &MyTone::stopOutputHook);
timer.setCallbackContext(num, (void*) this);
return true;
}
return false;
}
示例2: LowerDrill
// Lower drill, outputs 2sec pulse to lowering pin
void LowerDrill(){
DrillDown.on();
timer.setTimeout(2000, StopDrillMove);
}
示例3: LiftDrill
// Lift drill, outputs 2sec pulse to lifting pin.
void LiftDrill(){
DrillUp.on();
timer.setTimeout(2000, StopDrillMove);
}
示例4: 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
}