/** * @params data pointer to data port pin * @params sck pointer to sck port pin * @params timing 0: use send slot: >0: ms send interval * @params tPtr Pointer so SHT10 class * @params pPtr Pointer so BMP180 class * @params lPtr Pointer so TSL2561 class */ void SHT10_BMP085_TSL2561::config(uint8_t data, uint8_t sck, uint16_t timing, Sensirion *tPtr, BMP085 *pPtr, TSL2561 *lPtr) { tTiming = timing; nTime = 1000; // set the first time we like to measure startTime = millis(); nAction = SHT10_BMP085_TSL2561_nACTION_MEASURE_INIT; tsl2561InitCount = 0; sht10 = tPtr; sht10->config(data,sck); // configure the sensor sht10->writeSR(LOW_RES); // low resolution is enough if (pPtr != NULL) { // only if there is a valid module defined bm180 = pPtr; } if (lPtr != NULL) { // only if there is a valid module defined tsl2561 = lPtr; tsl2561->begin(TSL2561_ADDR_0); // Check if tsl2561 available if (tsl2561->setPowerUp()) { // config tsl2561 interrupt pin pinMode(A0, INPUT_PULLUP); // setting the pin to input mode registerInt(A0,s_dlgt(this,&SHT10_BMP085_TSL2561::tsl2561_ISR)); // setting the interrupt and port mask } } }
void registerAllTypes(asIScriptEngine* engine) { registerColor(engine); registerInt(engine); registerIntVector(engine); registerFloat(engine); registerFloatVector(engine); registerGradient(engine); registerPoint(engine); registerRect(engine); registerString(engine); registerMesh(engine); // After Point registerPath(engine); // After Point registerPolygon(engine); // After Path registerAnimation(engine); }
void Buttons::config(uint8_t Cnl, uint8_t Pin, uint16_t TimeOutShortDbl, uint16_t LongKeyTime, uint16_t TimeOutLongDdbl, void tCallBack(uint8_t, uint8_t)) { // settings while setup idx = Cnl; // set the index in the interrupt array pinMode(Pin, INPUT_PULLUP); // setting the pin to input mode toShDbl = TimeOutShortDbl; // minimum time to be recognized as a short key press lngKeyTme = LongKeyTime; // time key should be pressed to be recognized as a long key press toLoDbl = TimeOutLongDdbl; // maximum time between a double key press callBack = tCallBack; // call back address for button state display // default settings cFlag = 0; // no need for the poll routine at the moment cStat = 1; // active low, means last state should be active to get the next change lStat = 1; dblLo = 0; // counter for a double low rptLo = 0; // counter for repeated low registerInt(Pin,s_dlgt(this,&Buttons::interrupt)); // setting the interrupt and port mask // Serial << "pin:" << tPin << ", idx:" << pci.idx[pci.nbr] << ", prt:" << pinPort << ", msk:" << (1 << digitalPinToPCMSKbit(tPin)) << '\n'; }