5% OFF Over $19, Code: Elephant5; 10% OFF Over $59, Code: Elephant10



Yahboom Omibox Robot Kit arduino IDE course 5.10 Color recognition

Posted by Fiona Su on

Yahboom Omibox Robot Kit arduino IDE course 5.10 Color recognition

1.Learning goals

1-1.The position of the Color Recognition sensor on the robot car

1-2. Learn how to use color recognition sensors by programming

2.Preparation

image.png

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.

3.About code

Please see the colorsensor.ino file for this experimental procedure.

4.Download code

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.

image.png

image.png

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.

image.png

image.png

5.Experimental phenomena

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.

image.png  

image.png 

image.png

The code of the experiment:  10.Color recognition.rar

 

0 comments

Leave a comment

Please note, comments must be approved before they are published