Re: Need help with PI PICO...

Liste des GroupesRevenir à cs raspberry-pi 
Sujet : Re: Need help with PI PICO...
De : bnl (at) *nospam* nowhere.com (Björn Lundin)
Groupes : comp.sys.raspberry-pi
Date : 28. Mar 2024, 10:35:39
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uu3a4r$3f1sd$1@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
On 2024-03-25 16:57, The Natural Philosopher wrote:
That is, some asynchrounous event in this sequence
      gpio_put(ULTRASONIC_OUT,1);
     sleep_us(10);
     gpio_put(ULTRASONIC_OUT,0); //reset the input
//if asynch event lasting more than 100uS occurs here...
     // wait for echo pulse start
     while(!gpio_get(ULTRASONIC_IN))
         ;
//then the low-high-low echo pulse will never be detected.
if you change the wait body to include a counter then you could realize that when the counter had reached a high number - you missed the pulse.
Just try again then. Getting a reading is not that time sensitive - or?
:START
       int cnt = 0;
       gpio_put(ULTRASONIC_OUT,1);
       sleep_us(10);
       gpio_put(ULTRASONIC_OUT,0); //reset the input
  //if asynch event lasting more than 100uS occurs here...
       // wait for echo pulse start
       while(TRUE) {
         if (! gpio_get(ULTRASONIC_IN)) {
            cnt++
         } else {
           break;
         }
         if (cnt >= TOO_HIGH_VALUE) {
            goto START;
         }
       }
--
/Björn

Date Sujet#  Auteur
23 Mar 24 * Need help with PI PICO...35The Natural Philosopher
23 Mar 24 +* Re: Need help with PI PICO...30Ahem A Rivet's Shot
24 Mar 24 i`* Re: Need help with PI PICO...29The Natural Philosopher
24 Mar 24 i +* Re: Need help with PI PICO...27Ahem A Rivet's Shot
24 Mar 24 i i`* Re: Need help with PI PICO...26The Natural Philosopher
25 Mar 24 i i `* Re: Need help with PI PICO...25Pancho
25 Mar 24 i i  `* Re: Need help with PI PICO...24The Natural Philosopher
26 Mar 24 i i   +- Re: Need help with PI PICO...1The Natural Philosopher
26 Mar 24 i i   +* Re: Need help with PI PICO...6Ahem A Rivet's Shot
26 Mar 24 i i   i`* Re: Need help with PI PICO...5The Natural Philosopher
26 Mar 24 i i   i `* Re: Need help with PI PICO...4David Higton
27 Mar 24 i i   i  `* Re: Need help with PI PICO...3The Natural Philosopher
28 Mar 24 i i   i   `* Re: Need help with PI PICO...2Robert Riches
28 Mar 24 i i   i    `- Re: Need help with PI PICO...1The Natural Philosopher
26 Mar 24 i i   +* Re: Need help with PI PICO...12Pancho
27 Mar 24 i i   i`* Re: Need help with PI PICO...11The Natural Philosopher
27 Mar 24 i i   i +* Re: Need help with PI PICO...2David Higton
27 Mar 24 i i   i i`- Re: Need help with PI PICO...1The Natural Philosopher
29 Mar 24 i i   i `* Re: Need help with PI PICO...8Pancho
29 Mar 24 i i   i  +* Re: Need help with PI PICO...6The Natural Philosopher
29 Mar 24 i i   i  i+* Re: Need help with PI PICO...2Pancho
29 Mar 24 i i   i  ii`- Re: Need help with PI PICO...1The Natural Philosopher
30 Mar 24 i i   i  i`* Re: Need help with PI PICO...3The Natural Philosopher
30 Mar 24 i i   i  i `* Re: Need help with PI PICO...2Pancho
30 Mar 24 i i   i  i  `- Re: Need help with PI PICO...1The Natural Philosopher
29 Mar 24 i i   i  `- Re: Need help with PI PICO...1druck
28 Mar 24 i i   +* Re: Need help with PI PICO...2Björn Lundin
28 Mar 24 i i   i`- Re: Need help with PI PICO...1The Natural Philosopher
29 Mar 24 i i   `* Re: Need help with PI PICO...2Michael Schwingen
29 Mar 24 i i    `- Re: Need help with PI PICO...1The Natural Philosopher
24 Mar 24 i `- Re: Need help with PI PICO...1Michael Schwingen
24 Mar 24 `* Re: Need help with PI PICO...4Theo
24 Mar 24  `* Re: Need help with PI PICO...3The Natural Philosopher
24 Mar 24   +- Re: Need help with PI PICO...1Michael Schwingen
24 Mar 24   `- Re: Need help with PI PICO...1Theo

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal