long Ultrasonic::timing() { TRIG_PORT &= ~(1 << TRIG_PIN); //digitalWrite(_trigPin, LOW); _delay_us(2); TRIG_PORT |= (1 << TRIG_PIN); //digitalWrite(_trigPin, HIGH); _delay_us(10); TRIG_PORT &= ~(1 << TRIG_PIN); //digitalWrite(_trigPin, LOW); return _pulseIn(HIGH, SONAR_TOUT); }
unsigned long Encoder::pulseIn(uint8_t pin, uint8_t state, unsigned long timeout) { return (_pulseIn(pin, state, timeout)/100L); }
unsigned long Encoder::pulseInNanoseconds(uint8_t pin, uint8_t state, unsigned long timeout) { return (_pulseIn(pin, state, timeout)*10L); }
unsigned long Encoder::pulseIn(uint8_t pin, uint8_t state) { return (_pulseIn(pin, state, 0L)/100L); }