Yahboom Omibox Robot Kit arduino IDE course 5.10 Color recognition
1-1.The position of the Color Recognition sensor on the robot car
1-2. Learn how to use color recognition sensors by programming
As shown in the above picture, we circled the Color Recognition sensor with a red wire frame.
According to the hardware manual, we can see that the Color Recognition sensor is connected to the A4, A5 of the Arduino.
The search light of Color Recognition sensor is connected to pin4 of the Uno board.
Please see the colorsensor.ino file for this experimental procedure.
1.We need to open the code of this experiment: Color recognition.ino, click“√” under the menu bar to compile the code, and wait for the word "Done compiling " in the lower right corner, as shown in the figure below.
2. Click 【Tools】 --- 【Board】 -- we need to choose Arduino Uno. As shown in the figure below.
3.In the menu bar of Arduino IDE, we need to select 【Tools】---【Port】--- selecting the port that the serial number displayed by the device manager, as shown in the figure below.
4. After the selection is completed, you need to click “ → ”under the menu bar to upload the code to the Arduino UNO board. When the word “Done uploading” appears in the lower left corner, the code has been successfully uploaded to the Arduino UNO board, as shown in the figure below.
After the program is uploaded, Open the power of the robot car.When the robot recognizes paper of different colors, the RGB lights will light up corresponding colors.
The code of the experiment: 10.Color recognition.rar