void _timerFunc() { unsigned char _lastCtrlKeyStat; _lastCtrlKeyStat = 1; _remainingTime++; while(1) { if(!--_remainingTime){ _releaseShutter(); _remainingTime = _setTime; } if((_lastCtrlKeyStat == 0) && (P1_2 == 0x00)){break;} _lastCtrlKeyStat = P1_2; showNum(1); DelayMs(1000); } _timerStatus = 0; showNum(1); DelayMs(2000); }
void QwtCounter::setValue( double v ) { QwtDoubleRange::setValue( v ); showNum( value() ); updateButtons(); }
bool RpgItem::init(int dataid) { if (theItemData->get(dataid,info)) { content = CCSprite::create(info.spriteName.c_str()); this->addChild(content); content->setAnchorPoint(ccp(0,0)); showNum(); return true; } return false; }
/*! \brief Notify a change of value */ void QwtCounter::valueChange() { if ( isValid() ) showNum( value() ); else d_data->valueEdit->setText( QString::null ); updateButtons(); if ( isValid() ) Q_EMIT valueChanged( value() ); }
static void showNode(Absyn *node, int indent) { if (node == NULL) { error("showNode got NULL node pointer"); } switch (node->type) { case ABSYN_NUM: showNum(node, indent); break; case ABSYN_STR: showStr(node, indent); break; case ABSYN_NUMTY: showNumTy(node, indent); break; case ABSYN_STRTY: showStrTy(node, indent); break; case ABSYN_CLASSTY: showClassTy(node, indent); break; case ABSYN_ARRAYTY: showArrayTy(node, indent); break; case ABSYN_DECLIST: showDecList(node, indent); break; case ABSYN_STRLIST: showStrList(node, indent); break; case ABSYN_VALLIST: showValList(node, indent); break; default: error("unknown node type %d in showAbsyn", node->type); } }
void main() { char _msg[32]; P1_5 = 0x00; _setTime = 10; _remainingTime = 20; _timerStatus = 0; lcdinit(); sprintf(_msg, "FAT TIMER Ver 2 "); lcdshowstring(0, _msg); sprintf(_msg, "Starting... "); lcdshowstring(1, _msg); DelayMs(2000); _showNum(0); _showNum(1); while(1) { //Start / Stop if(P1_2 == 0x00) { DelayMs(2); if(P1_2 == 0x00){ _timerStatus = 1; _remainingTime = _setTime; showNum(1); _timerFunc(); } } //+ / - if(P1_0 == 0x00) { DelayMs(2); if(P1_0 == 0x00) { if(_setTime > 1) { _setTime--; showNum(0); DelayMs(15); continue; } } }else if(P1_1 == 0x00) DelayMs(2); if(P1_1 == 0x00) { if(_setTime < 999) { _setTime++; showNum(0); DelayMs(15); continue; } } }//while }