PDA

View Full Version : determining which switch is pushed first.



Possum79
02-05-2010, 04:44 AM
Well the subject really says it all. I'm working on a project and I know I have done·this before but I cannot remember for the life of me how to determine which switch was pushed first of two. Basically I have two switches connected to my stamp and I want a reaction to happen depending on the series of pushes. If i get the left switch pushed then the right switch I want a motor to turn one direction. If the right switch is pushed first then the left switch I want the motor to go the other way. Im eventually going to get this going with 2 PIR sensors to detect when my cats walk in front of the bot then the·bot will chase them. So I have to know which way the cat came from. Im not looking for exact code just a good reference to get me going. I have been reading the books a lot and can't find it.

mikediv
02-05-2010, 09:40 AM
Possum I am not really sure what you are asking are you asking for code or how you should do this, becuase I would think it would be quite easy but you would just have to use 2 pins an I/O for each switch then read whichever switch is pushed and have it do whatever you want??
So just poll either input the switches are connected to.

$WMc%
02-05-2010, 10:23 AM
Possum79

Is it servo motor help you need?

Are you using the BOEBOT or something else?

Down south, We would let the Dog chase after the Cat. and use our bots for something more useful like cutting the grass and planting strawberry's.
If you really want a challenge, Build a bot that can pick fruit.(oranges,strawberry's,tomato's,etc) It would make You millions$$$$$

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Truth is out there············___$WMc%___······················ ······ BoogerWoods, FL. USA

Possum79
02-05-2010, 10:27 AM
Well an example of code would be nice but it's not the issue. I know how this is going to be wired. Basically on my boe bot I'm going to wire two pir sensors and if the cat runs from left to right I need to figure out how to use that. If the right sensor tiggers it doesn't neccesarily mean the Cat came from the right. I need to be able to monitor both sensors to see which direction the cat went so I can chase it.

I'm trying to explain it the best I can