TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: ANDY BURNS
from: THE NATURAL PHILOSOPHER
date: 2018-02-21 10:45:00
subject: Re: How to use while loop

On 21/02/18 07:42, Andy Burns wrote:
> The Natural Philosopher wrote:
>
>> print(last==readpin()?((last=readpin()==OPENED)?"Opened":"Closed"):"");
>>
>> I knew one line was possible!
>
> Apart from the case when the pin changes state between your two reads ..

Damn. :-)

Been there, done that ...."Your code has a bug - every twenty minutes or
so it simply locks up"...

Timer interrupt between two statements in the entire OS would do just that..

Thank god for ICE's

Friend worked on the original ARM OS. Itr would lock up ebvery ciuple of
hours. They fund a race coindition., A wait state made it lockup up
every couple of weeks. So they added two wait states, and that made it
only once every ten years 'At which point they will just put it down to
cosmic rays and reboot it anyway' he said 'if anyone was using the
computer switched on that long'

Doesn't the pi have GPIO interrupts?


--
All political activity makes complete sense once the proposition that
all government is basically a self-legalising protection racket, is
fully understood.

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.