Hello, I am new here at these forums, and I need some help with coding/connections. Ok, heres the scenario, my code is perfect, I know this because I have tried it on two other bots, working flawlessly, using the same MCU, the PIcaxe28x1 (AXE020) with the ULN2803A transistor array, and one L293D motor Driver chip in the 16 DIP socket. My connections are:
Two Base Motors- A-B connections
Playback- Portc 3
Record- Portc 2
Speaker- Output 0
Single Directioned motor, using another L293D chip (externally from the board) to drive the motor- connects to portc 4+5
Right Motor- Ouput 2
Left Motor- Output 1
Back Motor- Output 3
These three last motors use the Transistor array on the board to switch from highs and lows (on and off), making a 60° angle
The SRF05 is connected to Output 1(TTL (In between the Picaxe Chip and Darlington Array)) and Input 0
Everything works absoultely fine except its not doing what its supposed to (what the other two bots did) in according to the code.
What it actually does is, right when I plug in the power supply, it starts doing the first "beat" in the code, and continues doing that in an endless loop, everything works fine (the base motors, all of the transistor motors, and the externally drivin (by L293D) bi-directional motor, the Playback, record, and speaker, and the SRF05 LED blinks red (means it works)
What its supposed to do, I believe, is first roam around, using the base motors, and panning the externally driven motor with the SRF05 on top, search for an obstacle, and when it finds the obstacle, snake into place, and then start the sequence "beat", and from there it should continue until the minute or so is up, and then go onto a next object. You see, it doesnt do this, it just plays a single beat without searching.
Attatched is the code, can someone help please?
Two Base Motors- A-B connections
Playback- Portc 3
Record- Portc 2
Speaker- Output 0
Single Directioned motor, using another L293D chip (externally from the board) to drive the motor- connects to portc 4+5
Right Motor- Ouput 2
Left Motor- Output 1
Back Motor- Output 3
These three last motors use the Transistor array on the board to switch from highs and lows (on and off), making a 60° angle
The SRF05 is connected to Output 1(TTL (In between the Picaxe Chip and Darlington Array)) and Input 0
Everything works absoultely fine except its not doing what its supposed to (what the other two bots did) in according to the code.
What it actually does is, right when I plug in the power supply, it starts doing the first "beat" in the code, and continues doing that in an endless loop, everything works fine (the base motors, all of the transistor motors, and the externally drivin (by L293D) bi-directional motor, the Playback, record, and speaker, and the SRF05 LED blinks red (means it works)
What its supposed to do, I believe, is first roam around, using the base motors, and panning the externally driven motor with the SRF05 on top, search for an obstacle, and when it finds the obstacle, snake into place, and then start the sequence "beat", and from there it should continue until the minute or so is up, and then go onto a next object. You see, it doesnt do this, it just plays a single beat without searching.
Attatched is the code, can someone help please?
Attachments
-
19 KB Views: 18