PICAXE 08M2 Using PIN2 (C.5) as input?

Andrei IRL

Senior Member
Hello everybody.

I am maxed out on my INPUTS/OUTPUTS and have the need to used PIN2 (C.5) as an input pin.

So i have connected the pin to ground via 10K resistor.

Then i am driving it high using push button bringing it HIGH.

The problem is that when i press the push button the LED will only flicker once even though the button remains pushed.

Any idea what i might be doing wrong here?

The other PIN is working as it should, i.e the RELAY1 will stay ON as long as the button on PIN3 remains pushed.

Thanks very much.

Andrei.
Code:
setfreq m8 ` Running at 8Mhz, all pause values are x2 times
symbol greenled=0 	`ready LED
symbol RELAY1=1
		
main:
if pin5=1 then high greenled
else low greenled
end if
if pin3=1 then high relay1
else low relay1
endif
goto main
 

lbenson

Senior Member
Before "main:" add a "disconnect" statement, so that bringing C.5 high doesn't reboot the picaxe.
 
Top