Button command porta

spectrum

New Member
Hi,

it seems to me that the button command doesnt work on porta (28x1) . Does anyone have a sollusion for this problem ?

Thanks,

Spectrum
 

inglewoodpete

Senior Member
I have never tried to use the Button command. It just seemed to be too complicated for what I have ever wanted to do. The code I would use would be something like:

Code:
Symbol Pressed = 1
Symbol PushButton =  Pin2
'
    (code before)
    Do Until PortA PushButton = Pressed: Loop
    (code after)
Unfortunately, I'm at work so can't check that in the Programming Editor. If it doesn't, try the following:

Code:
Symbol Idle = 0
Symbol PushButton =  Pin2
'
    (code before)
Wait4Press: If PortA PushButton = Idle Goto Wait4Press
    (code after)
Edit: it appears that both of those options will not work on Port A. Refer to WA55's post, below.
 
Last edited:

westaust55

Moderator
The BUTTON command (like some other commands only work on the designated INPUT pins, which in the case of the 28X1 is port C. (Outputs are port d).
The command

Code:
SYMBOL pushbutton = pin2
Is trying to assign the tag “pushbutton” to port c pin 2 (physical pin 13)

Using port “a” as digital inputs is restricted to simple functions like:
IF porta 1 = 1 THEN GOTO xxxx
LET bit1 = porta 1
 
Top