homework board acting weird (very weird)
blink13
Posts: 65
PLEASE help me i tried doing a program that when a button was pushed a light would turn on· and off but whenever my finger gets close to the button the light turns on. This is·with out even touching the button. If how ever i do touch the button (not press it) the light will turn on and stay on untill i touch(not press) the button again this is conflicting with my programming and i dont know wearhter its workin or not please help.
heres my program:
'{$STAMP BS2}
'{$PBASIC 2.5}
DO
IF (IN3 = 1)THEN
·· HIGH 14
ENDIF
·IF (IN3 = 0)THEN
·LOW 14
· ENDIF
LOOP
heres my program:
'{$STAMP BS2}
'{$PBASIC 2.5}
DO
IF (IN3 = 1)THEN
·· HIGH 14
ENDIF
·IF (IN3 = 0)THEN
·LOW 14
· ENDIF
LOOP
Comments
You need a pull-up resistor (10 Kohms to 25 Kohms) to give your pin 3 a value, when the button is not pressed.
... then·write your code like this:
I suspect that you're going to add additional logic to your program -- because as it is you don't need a microcontroller; simply connect the trigger to the solenoid.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Post Edited (Jon Williams) : 1/30/2005 1:34:11 AM GMT