Diskusní téma: Lekce 9 - Měříme vzdálenost s HC-SR04
Datum | 07.02.2023 |
---|---|
Vložil | Ondra |
Titulek | funkce pulse in |
Podle me funkce pulsein vam bude merit blbosti.
V prekladu znamena ze pokud je nastaveno na echo=high potom funkce ceka az se zmeni signal z low na high a potom zacne merit cas a potom zastavi timer az prejde echo z high do low.
Ale vy potrebujete merit skutecny cas ktery ubiha jiz od doby kdy aktivujete PIN trig.
Podle me na to takhle jednoduse funkce pulsein nejde pouzit - ta vam meri delku pulsu (viz vyse) a nikoliv dobu od aktivace trigeru
Reads a pulse (either HIGH or LOW) on a pin. For example, if value is HIGH, pulseIn() waits for the pin to go from LOW to HIGH, starts timing, then waits for the pin to go LOW and stops timing. Returns the length of the pulse in microseconds or gives up and returns 0 if no complete pulse was received within the timeout.
———
Zpět na diskuzi