{"id":2939,"date":"2025-03-28T17:21:16","date_gmt":"2025-03-28T09:21:16","guid":{"rendered":"https:\/\/code.xedulab.com\/?p=2939"},"modified":"2025-03-31T13:53:06","modified_gmt":"2025-03-31T05:53:06","slug":"color-recognition-device-2","status":"publish","type":"post","link":"https:\/\/code.xedulab.com\/index.php\/2025\/03\/28\/color-recognition-device-2\/","title":{"rendered":"Color recognition device"},"content":{"rendered":"<button class=\"simplefavorite-button has-count preset\" data-postid=\"2939\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"1\" style=\"box-shadow:none;-webkit-box-shadow:none;-moz-box-shadow:none;background-color:#ffffff;border-color:#ffffff;color:#686868;\"><i class=\"sf-icon-favorite\" style=\"color:#686868;\"><\/i>\u6536\u85cf<span class=\"simplefavorite-button-count\" style=\"\">1<\/span><\/button>\n<p>Introduction: Use color sensors, four-way digital tubes, and RGB lights to recognize three colors.<br>Advanced: Intelligent sorting speed adjustment. Simulate the sorting effect of express delivery by combining motors and servos. Electric motors can be used for conveyor belts.<br>Advanced: Visual recognition for item classification.<br>Experiment: Physics Experiment: Color Display, Propagation of Light, Direct and Reflection.<\/p>\n\n\n\n<p>1\u3001<strong>Teaching objectives (knowledge preparation)<\/strong><\/p>\n\n\n\n<p>Master the color calibration method of color sensors. (The color sensor can recognize up to 3 colors, and each color needs to be calibrated separately. Calibration method: Press and hold the button on the color sensor. When the red light in the upper left corner flashes, place the color that needs to be calibrated, and then press the button briefly until the upper left corner light stays on, indicating successful recognition. Then you can test the calibration results.)<br>The control and use of color sensors can be achieved through programming.<br>Can be combined with real-life application scenarios and project devices.<\/p>\n\n\n\n<p><strong>2\u3001Teaching tasks<\/strong><\/p>\n\n\n\n<p>Using color sensors, four-way digital tubes, and RGB lights, achieve recognition of three colors and display them on the RGB lights. The three colors correspond to values of 1, 2, and 3. If the recognition is not successful, the color sensor returns a value of 0.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"930\" height=\"270\" src=\"https:\/\/code.xedulab.com\/wp-content\/uploads\/2025\/03\/image-19.png\" alt=\"\" class=\"wp-image-2941\" srcset=\"https:\/\/code.xedulab.com\/wp-content\/uploads\/2025\/03\/image-19.png 930w, https:\/\/code.xedulab.com\/wp-content\/uploads\/2025\/03\/image-19-300x87.png 300w, https:\/\/code.xedulab.com\/wp-content\/uploads\/2025\/03\/image-19-768x223.png 768w\" sizes=\"(max-width: 930px) 100vw, 930px\" \/><\/figure>\n\n\n\n<p><strong>3\u3001Preparation of teaching environment and equipment<\/strong><\/p>\n\n\n\n<p>Equipment List: Image (with label number 123456)<\/p>\n\n\n\n<p><strong>Equipment Serial Number Table<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>Serial number<\/td><td>number<\/td><td>equipment<\/td><td>Specifications<\/td><td>quantity<\/td><\/tr><tr><td>1<\/td><td>&nbsp;<\/td><td>Color Recognition<\/td><td>&nbsp;<\/td><td>1<\/td><\/tr><tr><td>2<\/td><td>&nbsp;<\/td><td>Four-digit Display<\/td><td>&nbsp;<\/td><td>1<\/td><\/tr><tr><td>3<\/td><td>&nbsp;<\/td><td>RGB Light<\/td><td>&nbsp;<\/td><td>1<\/td><\/tr><tr><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><td>&nbsp;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p><strong>Software: <\/strong>Smart Code programming software.<\/p>\n\n\n\n<p><strong>Hardware: <\/strong>SMART Code kit: Color Recognition, Four-digit Display, RGB Light.<\/p>\n\n\n\n<p><strong>Other: <\/strong>Several building block devices.<\/p>\n\n\n\n<p><strong>Detailed List of Structural Components<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td>Serial number<\/td><td>number<\/td><td>equipment<\/td><td>Specifications<\/td><td>quantity<\/td><\/tr><tr><td>1<\/td><td>&nbsp;<\/td><td>3-hole beam<\/td><td>&nbsp;<\/td><td>18<\/td><\/tr><tr><td>2<\/td><td>&nbsp;<\/td><td>7-hole beam<\/td><td>&nbsp;<\/td><td>6<\/td><\/tr><tr><td>3<\/td><td>&nbsp;<\/td><td>13-hole beam<\/td><td>&nbsp;<\/td><td>6<\/td><\/tr><tr><td>4<\/td><td>&nbsp;<\/td><td>T-shaped beam<\/td><td>&nbsp;<\/td><td>6<\/td><\/tr><tr><td>5<\/td><td>&nbsp;<\/td><td>Black sales<\/td><td>&nbsp;<\/td><td>54<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Note: Materials required to fix a set of sensors: 6 3-hole beams, 2 7-hole beams, 2 13 hole beams, 2 T-shaped beams, and 18 black pins.<\/p>\n\n\n\n<p><strong>4\u3001Project Practice Process<\/strong><\/p>\n\n\n\n<p>(Summary of Knowledge Points: 1. Components. 2. Program Modules. 3. Program Design)<\/p>\n\n\n\n<p>1.<strong>Project video (in video format)<\/strong><\/p>\n\n\n\n<p>2.<strong>Project Steps<\/strong><\/p>\n\n\n\n<p>1.Fixed color sensor with four-way digital tube and RGB light.<\/p>\n\n\n\n<p>2.Use SMART Code software for programming.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><\/li>\n<\/ol>\n\n\n\n<p>Firstly, create a program entrance. The example code is as follows:<\/p>\n\n\n\n<p>Then, display the value 0 of the color sensor&#8217;s undetected color status on the four-way digital display. The example code is as follows:<\/p>\n\n\n\n<p>Then, manually mark 3 colors, you can try marking red, green, and blue.<\/p>\n\n\n\n<p>Then, after successful marking, make a judgment in the program and display the corresponding marked color on the RGB light. The example code is as follows:<\/p>\n\n\n\n<p>Finally, complete the entire code. The example code is as follows:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"801\" height=\"1024\" src=\"https:\/\/code.xedulab.com\/wp-content\/uploads\/2025\/03\/image-20-801x1024.png\" alt=\"\" class=\"wp-image-2942\" srcset=\"https:\/\/code.xedulab.com\/wp-content\/uploads\/2025\/03\/image-20-801x1024.png 801w, https:\/\/code.xedulab.com\/wp-content\/uploads\/2025\/03\/image-20-235x300.png 235w, https:\/\/code.xedulab.com\/wp-content\/uploads\/2025\/03\/image-20-768x982.png 768w, https:\/\/code.xedulab.com\/wp-content\/uploads\/2025\/03\/image-20.png 865w\" sizes=\"(max-width: 801px) 100vw, 801px\" \/><\/figure>\n\n\n\n<p>3.Interesting thinking: Identify different values of color feedback and find patterns.<\/p>\n\n\n\n<p>3.<strong>Reflection and discussion:<\/strong> What are the factors that affect the success rate of color sensor recognition\uff1f<\/p>\n\n\n\n<p>Experimental results<\/p>\n\n\n\n<p>Data records: Table 1 and Table 2<\/p>\n\n\n\n<p>Experimental conclusion:<\/p>\n\n\n\n<p><strong>5\u3001Extension and Expansion<\/strong><\/p>\n\n\n\n<p>Reflection and exploration:<\/p>\n\n\n\n<p>Question 1:<\/p>\n\n\n\n<p>Question 2:<\/p>\n<button class=\"simplefavorite-button has-count preset\" data-postid=\"2939\" data-siteid=\"1\" data-groupid=\"1\" data-favoritecount=\"1\" style=\"box-shadow:none;-webkit-box-shadow:none;-moz-box-shadow:none;background-color:#ffffff;border-color:#ffffff;color:#686868;\"><i class=\"sf-icon-favorite\" style=\"color:#686868;\"><\/i>\u6536\u85cf<span class=\"simplefavorite-button-count\" style=\"\">1<\/span><\/button>","protected":false},"excerpt":{"rendered":"<p>\u6536\u85cf1 Introduction: Use color sensors, four-way digital t&#8230;<\/p>\n","protected":false},"author":16,"featured_media":2943,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-2939","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-c3"],"_links":{"self":[{"href":"https:\/\/code.xedulab.com\/index.php\/wp-json\/wp\/v2\/posts\/2939","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code.xedulab.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code.xedulab.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code.xedulab.com\/index.php\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/code.xedulab.com\/index.php\/wp-json\/wp\/v2\/comments?post=2939"}],"version-history":[{"count":1,"href":"https:\/\/code.xedulab.com\/index.php\/wp-json\/wp\/v2\/posts\/2939\/revisions"}],"predecessor-version":[{"id":2944,"href":"https:\/\/code.xedulab.com\/index.php\/wp-json\/wp\/v2\/posts\/2939\/revisions\/2944"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code.xedulab.com\/index.php\/wp-json\/wp\/v2\/media\/2943"}],"wp:attachment":[{"href":"https:\/\/code.xedulab.com\/index.php\/wp-json\/wp\/v2\/media?parent=2939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code.xedulab.com\/index.php\/wp-json\/wp\/v2\/categories?post=2939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code.xedulab.com\/index.php\/wp-json\/wp\/v2\/tags?post=2939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}