Why won't this quit?
aux_pin0 VAR Bit
AUXIO
POLLIN 0,0
POLLOUT 15,1
MAINIO
POLLOUT 15,1
POLLMODE 4
AUXIO
aux_pin0 = IN0
DO
DEBUG "I am still waiting" , TAB , DEC aux_pin0, CR
AUXIO
aux_pin0 = IN0
MAINIO
IF aux_pin0 = 0 THEN
MAINIO
POLLMODE 7
AUXIO
POLLMODE 7
aux_pin0=0
EXIT
STOP
ENDIF
LOOP
MAINIO
POLLMODE 7
AUXIO
POLLMODE 7
IOTERM 0
OUTS = %0000000000000000 'All logic low
IOTERM 1
OUTS = %0000000000000000 'All logic low
DEBUG "I'm finished"
This is pretty frustrating. Is it because I am using polling? The program simply pauses if I ground the input pin. I thought it was supposed to stop.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Freeing smoke from wire and IC captivity since 1972

Comments
Fiirst, you DO ... LOOP has no exit condition supplied, so it becomes an infinte loop. Thus, you must exit by some means from within that code segment. The ONLY exixt feasible, ONLY occurs:
IF aux_pin0 = 0 THEN
Now, aux_pin0 = In0 subordinate to an AUXIO, thus it's pin port 0 of the auxilliary set, which maps to physical pin 21. Is there anything attached to physical pin 21? If so, does the state of pin 21 ever change?
Regards,
Bruce Bates
When PP24 goes low, the Stamp seems to go into a wait and see kind of operation and the lines after the LOOP statement never get executed. When I set the physical pin 24 to high again, the program restarts.
Is this behavior due to the use of the poll commands? What else could cause it? When I write a similiar program w/o polling, the Stamp works like expected.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Freeing smoke from wire and IC captivity since 1972
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Freeing smoke from wire and IC captivity since 1972
Anyone please respond.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Freeing smoke from wire and IC captivity since 1972
In the Basic Stamp Manual, it makes refernce running continuously on page 308 and going back to the start of the program.
So it was because of the pollmode that made it continuosly run. I'll now work on how to make it run as expected.
Always looking for feedback...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Freeing smoke from wire and IC captivity since 1972
'discovery0.bsp ' {$STAMP BS2p} ' {$PBASIC 2.5} aux_pin0 VAR Bit MAINIO aux_pin0 = IN0 DEBUG "I'm preparing to start..." , TAB, DEC aux_pin0, CR MAINIO POLLIN 0,1 POLLOUT 15,1 AUXIO POLLOUT 15,1 POLLMODE 4 DEBUG "I'm starting...", TAB, DEC aux_pin0, CR DO WHILE (aux_pin0= 1) MAINIO aux_pin0 = IN0 DEBUG "I'm still waiting...",TAB, DEC aux_pin0, CR IF aux_pin0=0 THEN POLLMODE 0 EXIT ENDIF LOOP IOTERM 0 OUTS = %0000000000000000 'All logic low IOTERM 1 OUTS = %0000000000000000 'All logic low DEBUG "I'm finished"I simply needed to change the pollmode inside the loop to pollmode 0. I had been trying to keep the pollmodes the same in the first section and in the loop.
Anyway. Thanks for the help. I'm sure I'll post some more.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Freeing smoke from wire and IC captivity since 1972
It was interesting to see you work your way throught the problem, even if much of the conversation was between yourself.
Thanks for taking the time to post your solution.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John R.
8 + 8 = 10
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10