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);
    }
예제 #2
0
파일: Encoder.cpp 프로젝트: drbokko/86Duino
unsigned long Encoder::pulseIn(uint8_t pin, uint8_t state, unsigned long timeout) {
	return (_pulseIn(pin, state, timeout)/100L);
}
예제 #3
0
파일: Encoder.cpp 프로젝트: drbokko/86Duino
unsigned long Encoder::pulseInNanoseconds(uint8_t pin, uint8_t state, unsigned long timeout) {
	return (_pulseIn(pin, state, timeout)*10L);
}
예제 #4
0
파일: Encoder.cpp 프로젝트: drbokko/86Duino
unsigned long Encoder::pulseIn(uint8_t pin, uint8_t state) {
	return (_pulseIn(pin, state, 0L)/100L);
}