Re: Need help with PI PICO...

Liste des GroupesRevenir à cs raspberry-pi 
Sujet : Re: Need help with PI PICO...
De : Pancho.Jones (at) *nospam* proton.me (Pancho)
Groupes : comp.sys.raspberry-pi
Date : 26. Mar 2024, 23:58:09
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <utvgdi$2cg59$1@dont-email.me>
References : 1 2 3 4 5 6 7
User-Agent : Mozilla Thunderbird
On 25/03/2024 15:57, The Natural Philosopher wrote:
On 25/03/2024 11:31, Pancho wrote:
On 24/03/2024 11:13, The Natural Philosopher wrote:
>
However on trawling the internet I discovered a conversation  with someone else *on here* (c.s.r-pi) last year, who was finding that *sleep_us(x)* was highly inconsistent for certain (small) values of x. Sometimes taking a day to end.
>
Further investigation reveals that in fact it really is a 'sleep' with the processor being put in low power mode and requiring an interrupt to 'wake it up'.
>
>
Why not use threads/timers, wait on a lock/semaphore rather than sleep.
>
Good point Pancho, but I was really looking for the simplest code possible.  Interrupts can be tricky things on a platform whose architecture you do not understand completely. In any case it was a learnning curve I preferred not to negotiate if i didnt need to
 
A timer isn't complicated, just a call back routine, and a semaphore. Interrupts are something an OS does, not me :o). I hate multithread code, but async handling of an external resource is one of the two main places I would use another thread.
I had a look at your code, it looks extraordinarily like a python example on Tom's hardware.
I'm not clear how many times it is succeeding vs failing, but I suspect you really need to bite the bullet and introduce timeouts/error handling, if it fails try again, average out multiple results. i.e. accept it as flawed and that results are statistical, like GPS.
In many ways the resilience code will be simple, because it is just normal code, rather than cargo culting a novel ultrasonic device.
You can investigate further, by recording fail stats, as well as distance stats.

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