I know that there is probably a stupidly simply solution to this, but for the life of me I can't see it.
Building simple robots in class room situation, using the 14M to drive the things, a L293D is driving two motors, a couple of micro switches on the front to detect when it runs into a wall etc. The input pins of the 14M are all tied low via 10k resistors (one resistor per input). Two of the inputs are connected to the micro switches and go high when the switches close.
Can write a simple program to switch on the motors on and get the robots moving, but when I add in the code to see if the switches have gone high (when the bot runs into something) then the motors stop and begin to 'hunt' (ie perform a very small incremental shuffle back and forth).
Have played with the software, which runs OK in the simulation, the best I've managed to do is to get the motors to stop completely. Am using an IF...THEN statement to do this, eg. IF pin2 = 1 THEN motorstop
Checked pins with logic probe for highs and lows, everything seems OK
Suspected hardware issue and built the circuit (used new set of components) up on a prototype board, have exactly the same problems.
Talk about frustations, if I had hair I'd be pulling it out.
Any suggetions?
Building simple robots in class room situation, using the 14M to drive the things, a L293D is driving two motors, a couple of micro switches on the front to detect when it runs into a wall etc. The input pins of the 14M are all tied low via 10k resistors (one resistor per input). Two of the inputs are connected to the micro switches and go high when the switches close.
Can write a simple program to switch on the motors on and get the robots moving, but when I add in the code to see if the switches have gone high (when the bot runs into something) then the motors stop and begin to 'hunt' (ie perform a very small incremental shuffle back and forth).
Have played with the software, which runs OK in the simulation, the best I've managed to do is to get the motors to stop completely. Am using an IF...THEN statement to do this, eg. IF pin2 = 1 THEN motorstop
Checked pins with logic probe for highs and lows, everything seems OK
Suspected hardware issue and built the circuit (used new set of components) up on a prototype board, have exactly the same problems.
Talk about frustations, if I had hair I'd be pulling it out.
Any suggetions?