Picaxe motor output pin use
This is a nice little hack I discovered that allows you to use LEDs on your Picaxe-28 robot without taking up any other pins.
When the picaxe 28 board is used with the L293D motor driver chip, the picaxe chip sends power to the motor output on the board as well as the normal output pins. This can be used to give the robot headlights, reversing lights, direction indicators or, for the evil robot emerging from the darkness look, light up eyes. With my motors and a 4.5V power supply, the current was kept low enough because the motors draw more current, so I did not need a resistor. but be careful, YOU MAY NEED TO LIMIT THE CURRENT, I AM NOT SURE.
The idea is fairly simple. When the direction commands are used, the controller sends power to one, or both outputs connected to the motor, and the motor driver chip converts this to the following output on the board motor connections:
both inputs low -motor halt
first output high, second low -motor forward
first output low, second high -motor reverse
both inputs high -motor halt
as the chip uses outputs 4,5,6 and 7, this means that when the motor runs forward, output 5 is high for one motor, and 7 for the other. When in reverse, outputs 4 and 6 are used.
When turning, one motor is forward and one is reverse, so the robot will turn in the direction of the reversed motor, so by connecting an LED to each reverse output, (a flashing one looks even better) you have some nice indicator lights. when both motors reverse, you will have reversing lights.
A bi-colour LED can be connected to any ground pin, and the two (+) legs to a forward and a reverse, to make it one colour when forwards, anda different one for reverse.
These are just a few possibilities for this function, It may also be possible to add other components.