In my previous post (My Raspberry Pi Robot (Let's Get Portable! Contest)) I presented my robot for the Let's Get Portable! contest. In this post I will describe the pins I used for controlling the two engines and the for LED's, also the programming languages with the additional libraries for image processing and controlling the pins.
First of all, I used pin nr. 2 for supplying with electricity the bridge driver. Secondly, I used pins nr. 15 with 13 for the right engine and 12 with 11 for the left engine. When both pins of an engine are set to Low or High, the engine is not working, when one of the pins is set to High, then the engine is spinning in one direction, when the other pin is set to High, then the engine is spinning in the other direction. So, when the pins 15 and 11 are on High, the engines are spinning the wheels forward, when the pins 13 and 12 are on High, the engines are spinning the wheels backwards. This is how I control wirelessly the robot, from a laptop, using one of the applications I developed. Thirdly, I used the pins nr. 7, 16, 18 and 22 for turning on and off the LED's from the back of the robot. They are good for debugging the applications, and they give a cool look also.
On the Raspberry Pi, I used Raspbian operating system. For the applications I used Python programming language with its default RPi.GPIO (https://pypi.python.org/pypi/RPi.GPIO) library for controlling the pins, C/C++ with OpenCV (OpenCV) library, for image processing, V4L2 driver ( Official V4L2 driver) for collecting images from the Raspberry Cam using OpenCV, and bcm298 (bcm2835) library for controlling the pins. I also made a simple GUI using C# and WPF for controlling the robot from the keyboard of the my laptop and to start and stop the other applications.
If somebody has questions, please ask them and I will describe more specific every step I took to realize this project.