lbenson
Senior Member
This is on a 28X1 with firmware version A.2.
When I execute hsersetup, input pin 6 appears always to be on.
When I run the following code, it gets stuck in the "do" loop after "if pin6 = 1 then" and never reaches the sertxd printouts. If I comment out the "hsersetup" line, it works as expected. If I change pin6 to pin0 and rewire, it works as expected.
I found the reason. I'll go ahead with the post in case anyone else searches for the problem. As manual 2 states for the hsersetup statement, hsersetup configures both hserin and hserout. The hserout pin is input pin 6, so that pin cannot be used as a normal input pin.
When I execute hsersetup, input pin 6 appears always to be on.
When I run the following code, it gets stuck in the "do" loop after "if pin6 = 1 then" and never reaches the sertxd printouts. If I comment out the "hsersetup" line, it works as expected. If I change pin6 to pin0 and rewire, it works as expected.
Code:
#picaxe 28X1
start:
pause 1000
hsersetup B2400_4, %1 ' set up background receive (on I7)
hserinflag = 0
b1 = 0
main:
if pin6 = 1 then
do while pin6 = 1
loop
sertxd ("Button pressed",13,10)
endif
inc b1
sertxd ("loop ", #b1,13,10)
pause 2000
goto main