Link to home
Start Free TrialLog in
Avatar of 940775
940775

asked on

BASIC STAMP : How to input bits into an accumilator

Lets say I have two push button switches connected to the input port of a basic stamp. What I want to know is how to write a simple program to input a "1" when the 1st button is press and a "0" when the sexond button is pressed. I'll have the the 5v connected to both switches and a not gate connected to the second.
Avatar of LRHGuy
LRHGuy

If I understand the problem, you want to use ONE input port, which to the stamp is either a 1 or a 0, and connect two buttons to it to detect either a 1 or a 0 .... it doesn't seem possible.

You'd need a tri-state input for that...which would be "seen" as a 1 a 0 or "not a 1 or 0" as the third state. I don't believe the stamp can do that.

Now it you're using two input ports, no problem!
Avatar of 940775

ASKER

OK LRHGuy, lets use two input ports. How would you write the code  (just an example)?
ASKER CERTIFIED SOLUTION
Avatar of LRHGuy
LRHGuy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial