Example #1
0
void BoozeSensor::update() {
  if (IsOn()) {
    unsigned int elapsed = millis() - last_sample_time_;
    if (elapsed >= 400)
      TakeSample();
  }
}
Example #2
0
void CompTrainer::SampleEachStream(size_t nSampleCnt)
{
    for (size_t i = 0; i < nSampleCnt; i++)
    {
        for (size_t j = 0; j < m_rMemPool.size(); j++)
            TakeSample(j, m_rMemPool[j]->GetBufFullness());
        usleep(SAMPLE_INTERVAL*1000);
    }
}