No the code doesn't run at allDoes your code run once? Also add pauses between commands to ensure they have time to respond. I will have a closer look later when I get home
with the motors connected its reading 0 - 0.1 v not sure why but im going to see if adding a seperate battery to power the motors worksI'm having trouble reading your circuit diagram - bad choice of colours for my computer. It looks like the power for the motor comes from the PICAXE supply (I can't see a voltage regulator). So, assuming a 5.0 volt power source, the voltage after the diode would be around 4.3 volts. If a motor is trying to draw around 600mA at startup, the available voltage at the output of the L293D (according to the data sheet) would be 4.3 - 2.6 = 1.7 volts. If powered from 3 x AA cells, the voltage available could be lower.
Can you measure the voltage available at the output terminals of the L293D: (1) with no motor connected and (2) with the motor connected, and report back to us?
0 ohm resistors, just there to jump over tracksI can't see the detail in you circuit diagram. What value are you using for the input resistors for the L293D?
Sorry, I added another question while you were answering.0 ohm resistors, just there to jump over tracks
b.4 = 0I can't see the detail in you circuit diagram. What value are you using for the input resistors for the L293D?
Also, what voltage are you reading on EACH output B.4, B.5, B.6 and B.7 with respect to Ground/0v?
#picaxe 18m2
#no_data
symbol LED1 = C.0
symbol LED2 = C.1
low LED1
high LED2
do
pause 2000
toggle LED1
toggle LED2
loop
I'll test that code when I can, thanks. I'm using two AA batteries and I added capacitors to the motors , I've also tried using four AA batteries but that doesn't seem to work either.2.81 volts seems quite low.
What type of battery AAA, AA, C, D, or other (stabilised) power supply are you using? and what voltage is going to the PICAXE board?
I can't see any capacitors in your circuit, so the problem could be that when a motor attempts to start it causes a power dip which resets the PICAXE.
Try adding a 100nF and 100uF capacitor across the supply rails as close as possible to the PICAXE. See C1 & C2 in the schematic of post 5.
I notice you have 2 LEDs in your circuit, so it might be worth disconnecting both motors (or preferably removing the L293D if it's in a socket) and then running a simple test just to see if the LEDs flash alternatively. If that works, then you could try reconnecting the motors and re-insert the L293D.
Now insert your code from post 1 so that it's just before low LED1 and see if the LEDs still flash as before or whether you get erratic behaviour due to the motors trying to start.
Code:#picaxe 18m2 #no_data symbol LED1 = C.0 symbol LED2 = C.1 low LED1 high LED2 do pause 2000 toggle LED1 toggle LED2 loop
I'm having trouble reading your circuit diagram [he's not the only one ] ........ assuming a 5.0 volt power source, the voltage after the diode would be around 4.3 volts. If a motor is trying to draw around 600mA at startup, the available voltage at the output of the L293D (according to the data sheet) would be 4.3 - 2.6 = 1.7 volts. If powered from 3 x AA cells, the voltage available could be lower.
So how did you expect it to work? Two fresh alkaline AAs will deliver 3.0 volts at best, but less if they have been used previously and/or when loaded by a motor. Or two Rechargeable cells (NiMH) would give no more than 2.5 volts. So I'd expect there to be no useful voltage at all available across the motors.I'm using two AA batteries ,...
That's the voice of experience!Start wiggling wires to look for intermittents.