Recently I received a Smart Car Robot Kit donated by Elegoo for the Visuino development, and I already posted a Tutorial on how to assemble the Kit.
Here I will show you how easy it is to program the Robot with Visuino so you can control it with Infrared Remote.
One assembled Elegoo Smart Car Robot car and the Infrared Remote included in the kit (Picture 1)
Pictures 2, and 3 show the unassembled kit.
To start programming the Arduino, you will need to have the Arduino IDE installed from here: http://www.arduino.cc/.
Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work!
The Visuino: https://www.visuino.com also needs to be installed.
You can control the motor speeds directly, however if you suddenly change the motor from stopped to full speed, or from full speed to stop, this will make the robot movements "jumpy", and may lead to wheels easily detaching from the robot. It is better to speed up and slow down the motors gradually using a ramp. Visuino includes "Ramp To Value" component designed for such purpose.
To control the motor speeds for the 4 commands from the remote (Forward, Backward, Left, and Right), and the Stop, we can use "Analog Value" component for each motor with value 0.5 - Stop, and 4 "Set Value State" elements specifying the motor speeds for the 4 commands.
To decode the infrared commands, we will add Infrared Receiver component. The simplest way to decode a specific command is to add Decode element to the Infrared Receiver Elements: We will add 4 such elements for the 4 commands - Forward, Back, Left and Right.
If you get compiler error in the Arduino IDE, this means that you are missing the following library:
https://github.com/z3t0/Arduino-IRremote
Look at this Tutorial to see how to install it!
Congratulations! You have a full Infrared Remote control over your Smart Car Robot.
If you power up the Smart Car Robot, you can control it by pressing on the Arrow buttons of the Infrared Remote as shown on the Video.
On the Picture you can see the complete Visuino diagram.
Also attached are the Visuino projects, that I created for this Tutorial. You can download and open them in Visuino: https://www.visuino.com