code problem

pheonixfire

New Member
I'm trying to get a 08m2 to only light a led when a button is pushed
but it keeps flashing even when the button isn't pushed

Could someone have a look and tell me where I made the error

Code:
main:
	if pinc.3 = 1 then;			Check if c3 is high
		pause 250;			   Wait for 250 miilliseconds
		if pinc.3 = 1 then;		Recheck if c3 is high
			high c.1;		       If it is then turn c1 high
		endif
	else
		if pinc.3 = 0 then;		If c3 is low turn
			low c.1;			c1 low
			;				   Otherwise do nothing
		endif
	endif
	goto main
any help is appreciated
pheonixfire
 

bpowell

Senior Member
Do you have a pull-down resistor installed on pin C.3? A 10k resistor to ground will keep the signal firmly "Low" until you press your switch.

Edit: And, welcome to the forum, and the wonderful world of PICAXE! :)
 
Last edited:
Top