{"id":19961,"date":"2020-12-01T16:52:36","date_gmt":"2020-12-01T13:22:36","guid":{"rendered":"https:\/\/thecaferobot.com\/learn\/?p=19961"},"modified":"2023-05-29T13:30:52","modified_gmt":"2023-05-29T09:00:52","slug":"interfacing-ws2812-led-rgb-color-module-with-arduino","status":"publish","type":"post","link":"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/","title":{"rendered":"\u0622\u0645\u0648\u0632\u0634 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u0627\u0698\u0648\u0644 LED RGB WS2812 \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"19961\" class=\"elementor elementor-19961\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-dfd2878 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"dfd2878\" data-element_type=\"section\">\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\r\n\t\t\t\t\t\t\t\t<div class=\"elementor-row\">\r\n\t\t\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4f5ec15\" data-id=\"4f5ec15\" data-element_type=\"column\">\r\n\r\n\t\t\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\r\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\r\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5e5acf8f elementor-widget elementor-widget-heading\" data-id=\"5e5acf8f\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">\u0648\u06cc\u0698\u06af\u06cc \u0647\u0627\u06cc \u0645\u0627\u0698\u0648\u0644 WS2812 - LED RGB<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-44f055fd elementor-widget elementor-widget-text-editor\" data-id=\"44f055fd\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t\u0645\u0627\u0698\u0648\u0644 WS2812 \u06cc\u06a9 \u0627\u0644 \u0627\u06cc \u062f\u06cc RGB \u0627\u0633\u062a. \u0627\u06cc\u0646 \u0645\u0627\u0698\u0648\u0644 \u0628\u0631 \u0631\u0648\u06cc \u062e\u0648\u062f \u06cc\u06a9 \u0639\u062f\u062f LED RGB \u067e\u0646\u062c \u0645\u06cc\u0644\u06cc \u0645\u062a\u0631\u06cc \u0631\u0627 \u0628\u0631\u0631\u0648\u06cc \u062e\u0648\u062f \u062f\u0627\u0631\u062f \u06a9\u0647 \u0642\u0627\u0628\u0644\u06cc\u062a \u0627\u06cc\u062c\u0627\u062f 16777216 \u0631\u0646\u06af \u0631\u0627 \u062f\u0627\u0631\u0627\u0633\u062a.\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3f456300 elementor-widget elementor-widget-image\" data-id=\"3f456300\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/WS2811-1.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"WS2811-1.jpg\" e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MTk5NjQsInVybCI6Imh0dHBzOlwvXC90aGVjYWZlcm9ib3QuY29tXC9sZWFyblwvd3AtY29udGVudFwvdXBsb2Fkc1wvMjAyMFwvMTFcL1dTMjgxMS0xLmpwZyJ9\">\n\t\t\t\t\t\t\t<img width=\"600\" height=\"600\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/WS2811-1.jpg\" class=\"attachment-large size-large\" alt=\"\u0645\u0627\u0698\u0648\u0644 WS2812 - LED RGB\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3ed9e4b6 elementor-widget elementor-widget-heading\" data-id=\"3ed9e4b6\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">\u0645\u0639\u0631\u0641\u06cc \u067e\u0627\u06cc\u0647 \u0647\u0627 (Pinout) \u0645\u0627\u0698\u0648\u0644 \u0627\u0644 \u0627\u06cc \u062f\u06cc WS2812 RGB<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-471b84cc elementor-widget elementor-widget-text-editor\" data-id=\"471b84cc\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u0645\u0627\u0698\u0648\u0644 \u0627\u0644 \u0627\u06cc \u062f\u06cc WS2812 RGB \u062f\u0627\u0631\u0627\u06cc 4 \u067e\u0627\u06cc\u0647 \u0628\u0647 \u0634\u0631\u062d \u0632\u06cc\u0631 \u0627\u0633\u062a:<\/p><ul><li>\u00a0<strong>VCC:<\/strong> \u062a\u063a\u0630\u06cc\u0647 \u0645\u0627\u0698\u0648\u0644 \u2013 5 \u0648\u0644\u062a<\/li><li>\u00a0<strong>GND:<\/strong> \u0632\u0645\u06cc\u0646<\/li><li>\u00a0<strong>DI:<\/strong> \u0648\u0631\u0648\u062f \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0627\u0632 \u0633\u0645\u062a \u0645\u06cc\u06a9\u0631\u0648 \u06cc\u0627 \u0645\u0627\u0698\u0648\u0644 \u0642\u0628\u0644\u06cc<\/li><li>\u00a0<strong>DO:<\/strong> \u062e\u0631\u0648\u062c\u06cc \u0627\u0637\u0644\u0627\u0639\u0627\u062a \u0628\u0647 \u0633\u0645\u062a \u0645\u0627\u0698\u0648\u0644 \u0628\u0639\u062f\u06cc<\/li><\/ul><p>\u067e\u06cc\u0646 \u0627\u0648\u062a (Pinout) \u0627\u06cc\u0646 \u0645\u0627\u0698\u0648\u0644 \u0631\u0627 \u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u062f\u0631 \u062a\u0635\u0648\u06cc\u0631 \u0632\u06cc\u0631 \u0645\u0634\u0627\u0647\u062f\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-852f6f1 elementor-widget elementor-widget-image\" data-id=\"852f6f1\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/WS2811-pin.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"WS2811-pin.jpg\" e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MTk5NjUsInVybCI6Imh0dHBzOlwvXC90aGVjYWZlcm9ib3QuY29tXC9sZWFyblwvd3AtY29udGVudFwvdXBsb2Fkc1wvMjAyMFwvMTFcL1dTMjgxMS1waW4uanBnIn0%3D\">\n\t\t\t\t\t\t\t<img width=\"800\" height=\"600\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/WS2811-pin.jpg\" class=\"attachment-large size-large\" alt=\"\u067e\u06cc\u0646 \u0627\u0648\u062a Pinout \u0645\u0627\u0698\u0648\u0644 WS2812 RGB\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-329076b9 elementor-widget elementor-widget-text-editor\" data-id=\"329076b9\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u062c\u0647\u062a \u062f\u0631\u06cc\u0627\u0641\u062a \u062f\u06cc\u062a\u0627\u0634\u06cc\u062a \u0627\u0644 \u0627\u06cc \u062f\u06cc WS2812 RGB \u0627\u06cc\u0646\u062c\u0627 \u06a9\u0644\u06cc\u06a9 \u06a9\u0646\u06cc\u062f.<\/p><p><div class='w3eden'><!-- WPDM Link Template: Default Template -->\n\n<div class=\"link-template-default card mb-2\">\n    <div class=\"card-body\">\n        <div class=\"media\">\n            <div class=\"mr-3 img-48\"><img class=\"wpdm_icon\" alt=\"Icon\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/plugins\/download-manager\/assets\/file-type-icons\/pdf.svg\" \/><\/div>\n            <div class=\"media-body\">\n                <h3 class=\"package-title\"><a href='https:\/\/thecaferobot.com\/learn\/download\/ws2812-rgb-module-datasheet\/'>WS2812 RGB Module Datasheet<\/a><\/h3>\n                <div class=\"text-muted text-small\"><i class=\"fas fa-copy\"><\/i> 1 file(s) <i class=\"fas fa-hdd ml-3\"><\/i> 347.03 KB<\/div>\n            <\/div>\n            <div class=\"ml-3\">\n                <a class='wpdm-download-link download-on-click btn btn-primary ' rel='nofollow' href='#' data-downloadurl=\"https:\/\/thecaferobot.com\/learn\/download\/ws2812-rgb-module-datasheet\/?wpdmdl=19969&#038;refresh=6a21f58760a181780610439\">Download<\/a>\n            <\/div>\n        <\/div>\n    <\/div>\n<\/div>\n\n<\/div><\/p><p>\u00a0<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2b0a97c5 elementor-widget elementor-widget-heading\" data-id=\"2b0a97c5\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">\u0644\u0648\u0627\u0632\u0645\u06cc \u06a9\u0647 \u0628\u0647 \u0622\u0646 \u0627\u062d\u062a\u06cc\u0627\u062c \u062f\u0627\u0631\u06cc\u062f<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2c7cd550 elementor-widget elementor-widget-image\" data-id=\"2c7cd550\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/WS2811-Required-Materials.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"WS2811-Required-Materials.jpg\" e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MTk5NjYsInVybCI6Imh0dHBzOlwvXC90aGVjYWZlcm9ib3QuY29tXC9sZWFyblwvd3AtY29udGVudFwvdXBsb2Fkc1wvMjAyMFwvMTFcL1dTMjgxMS1SZXF1aXJlZC1NYXRlcmlhbHMuanBnIn0%3D\">\n\t\t\t\t\t\t\t<img width=\"600\" height=\"500\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/WS2811-Required-Materials.jpg\" class=\"attachment-large size-large\" alt=\"\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-19d85b83 elementor-widget elementor-widget-text-editor\" data-id=\"19d85b83\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t\u0628\u0627 \u062a\u0648\u062c\u0647 \u0628\u0647 \u0646\u06cc\u0627\u0632 \u062e\u0648\u062f \u0627\u0632 \u06cc\u06a9\u06cc \u0627\u0632 \u0645\u06cc\u06a9\u0631\u0648\u06a9\u0646\u062a\u0631\u0644\u0631 \u0647\u0627\u06cc STM32 \u06cc\u0627 Arduino  \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f.\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3da5cda3 elementor-widget elementor-widget-heading\" data-id=\"3da5cda3\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u0642\u0637\u0639\u0627\u062a \u0645\u0648\u0631\u062f \u0646\u06cc\u0627\u0632 <\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-21ada137 elementor-widget elementor-widget-html\" data-id=\"21ada137\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<div class=\"table-2\">\r\n<table width=\"100%\" class=\"zebra\">\r\n<tbody>\r\n\r\n<tr>\r\n\t<td width=\"70%\">\u0628\u0631\u062f \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0646\u0627\u0646\u0648 * \r\n<\/td>\r\n\t<td class=\"center\" width=\"10%\">\u00d7<\/td>\r\n    <td class=\"center\" width=\"10%\">1<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/thecaferobot.com\/store\/nano-ch340g-arduino\" target=\"_blank\"><i class=\"fa fa-shopping-cart\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n<tr>\r\n\t<td width=\"70%\">\u0628\u0631\u062f \u0645\u06cc\u0646\u06cc \u0622\u0631\u0645 STM32F103C8T6\r\n*\r\n<\/td>\r\n\t<td class=\"center\" width=\"10%\">\u00d7<\/td>\r\n    <td class=\"center\" width=\"10%\">1<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/thecaferobot.com\/store\/stm32f103c8t6-arm-board\" target=\"_blank\"><i class=\"fa fa-shopping-cart\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n<tr>\r\n\t<td width=\"70%\">\u0645\u0627\u0698\u0648\u0644 WS2812 - LED RGB\r\n<\/td>\r\n\t<td class=\"center\" width=\"10%\">\u00d7<\/td>\r\n    <td class=\"center\" width=\"10%\">1<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/thecaferobot.com\/store\/ws2812-rgb-led-module\" target=\"_blank\"><i class=\"fa fa-shopping-cart\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n<tr>\r\n\t<td width=\"70%\">\u0633\u06cc\u0645 \u062c\u0627\u0645\u067e\u0631 \u0645\u0627\u062f\u06af\u06cc \u0628\u0647 \u0645\u0627\u062f\u06af\u06cc\r\n<\/td>\r\n\t<td class=\"center\" width=\"10%\">\u00d7<\/td>\r\n    <td class=\"center\" width=\"10%\">1<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/thecaferobot.com\/store\/female-female-40p-21cm\" target=\"_blank\"><i class=\"fa fa-shopping-cart\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n<\/tbody>\r\n<\/table>\r\n<\/div>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2c8af0ce elementor-widget elementor-widget-text-editor\" data-id=\"2c8af0ce\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t* \u0628\u0627 \u062a\u0648\u062c\u0647 \u0628\u0647 \u0646\u06cc\u0627\u0632 \u062e\u0648\u062f \u06cc\u06a9\u06cc \u0627\u0632 \u0645\u06cc\u06a9\u0631\u0648 \u06a9\u0646\u062a\u0631\u0644\u0631 \u0647\u0627\u06cc STM32 \u06cc\u0627 Arduino \u0631\u0627 \u062a\u0647\u06cc\u0647 \u06a9\u0646\u06cc\u062f.\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-36c5fbe4 elementor-widget elementor-widget-heading\" data-id=\"36c5fbe4\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u0646\u0631\u0645 \u0627\u0641\u0632\u0627\u0631\u0647\u0627\u06cc \u0645\u0648\u0631\u062f \u0646\u06cc\u0627\u0632<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-40e9959c elementor-widget elementor-widget-html\" data-id=\"40e9959c\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<div class=\"table-2\">\r\n<table width=\"100%\" class=\"zebra\">\r\n<tbody>\r\n\r\n<tr>\r\n\t<td width=\"90%\">\u0622\u0631\u062f\u0648\u06cc\u0646\u0648 IDE<\/td>\r\n\t<td class=\"center\" width=\"10%\"><a href=\"https:\/\/www.arduino.cc\/en\/Main\/Software\" target=\"_blank\"><i class=\"fa fa-info\" style=\"\"><\/i><\/a><\/td>\r\n<\/tr>\r\n\r\n\r\n<\/tbody>\r\n<\/table>\r\n<\/div>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6f215701 elementor-widget elementor-widget-heading\" data-id=\"6f215701\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">\u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u0627\u0698\u0648\u0644 \u0627\u0644 \u0627\u06cc \u062f\u06cc RGB WS2812 \u0628\u0627 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u0627\u0632 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0648 STM32<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-167c5389 elementor-widget elementor-widget-heading\" data-id=\"167c5389\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u06af\u0627\u0645 \u0627\u0648\u0644: \u0633\u06cc\u0645 \u0628\u0646\u062f\u06cc<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-50ff8f02 elementor-widget elementor-widget-text-editor\" data-id=\"50ff8f02\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t\u0645\u0637\u0627\u0628\u0642 \u0645\u062f\u0627\u0631 \u0632\u06cc\u0631\u060c \u0645\u0627\u0698\u0648\u0644 \u0631\u0627 \u0628\u0647 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u06cc\u0627 STM32 \u0648\u0635\u0644 \u06a9\u0646\u06cc\u062f. \t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-70cc7f76 elementor-widget elementor-widget-image\" data-id=\"70cc7f76\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/WS2811-wire.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"WS2811-wire.jpg\" e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MTk5NjcsInVybCI6Imh0dHBzOlwvXC90aGVjYWZlcm9ib3QuY29tXC9sZWFyblwvd3AtY29udGVudFwvdXBsb2Fkc1wvMjAyMFwvMTFcL1dTMjgxMS13aXJlLmpwZyJ9\">\n\t\t\t\t\t\t\t<img width=\"800\" height=\"599\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/WS2811-wire.jpg\" class=\"attachment-large size-large\" alt=\"\u0633\u06cc\u0645 \u0628\u0646\u062f\u06cc \u0645\u062f\u0627\u0631 \u0627\u062a\u0635\u0627\u0644 WS2812 \u0628\u0647 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-196c6ce7 elementor-widget elementor-widget-image\" data-id=\"196c6ce7\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-image\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/WS2811-wier_stm32.jpg\" data-elementor-open-lightbox=\"yes\" data-elementor-lightbox-title=\"WS2811-wier_stm32.jpg\" e-action-hash=\"#elementor-action%3Aaction%3Dlightbox%26settings%3DeyJpZCI6MTk5NjgsInVybCI6Imh0dHBzOlwvXC90aGVjYWZlcm9ib3QuY29tXC9sZWFyblwvd3AtY29udGVudFwvdXBsb2Fkc1wvMjAyMFwvMTFcL1dTMjgxMS13aWVyX3N0bTMyLmpwZyJ9\">\n\t\t\t\t\t\t\t<img width=\"800\" height=\"599\" src=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/WS2811-wier_stm32.jpg\" class=\"attachment-large size-large\" alt=\"\u0633\u06cc\u0645 \u0628\u0646\u062f\u06cc \u0645\u062f\u0627\u0631 \u0627\u062a\u0635\u0627\u0644 WS2812 \u0628\u0647 STM32\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t<\/a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3758afb3 elementor-widget elementor-widget-heading\" data-id=\"3758afb3\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">\u06af\u0627\u0645 \u062f\u0648\u0645: \u06a9\u062f<\/h3>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1390ce4e elementor-widget elementor-widget-text-editor\" data-id=\"1390ce4e\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u0627\u0628\u062a\u062f\u0627 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0632\u06cc\u0631 \u0631\u0627\u00a0 \u0628\u0631 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648\u06cc \u062e\u0648\u062f \u0646\u0635\u0628 \u06a9\u0646\u06cc\u062f.<\/p><p>\u0628\u0631\u0627\u06cc \u0628\u0631\u062f \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 :<\/p><p><a href=\"https:\/\/github.com\/FastLED\/FastLED\">https:\/\/github.com\/FastLED\/FastLED<\/a><\/p><p>\u0628\u0631\u0627\u06cc \u0628\u0631\u062f STM32<\/p><p><a href=\"https:\/\/github.com\/FearlessNight\/bluepill_ws2812\">https:\/\/github.com\/FearlessNight\/bluepill_ws2812<\/a><\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-722b04e4 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"722b04e4\" data-element_type=\"section\">\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\r\n\t\t\t\t\t\t\t\t<div class=\"elementor-row\">\r\n\t\t\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-7e40e904\" data-id=\"7e40e904\" data-element_type=\"column\" data-settings=\"{&quot;background_background&quot;:&quot;gradient&quot;}\">\r\n\r\n\t\t\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\r\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\r\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-7df1aa28 elementor-view-stacked elementor-widget__width-auto elementor-absolute elementor-shape-circle elementor-widget elementor-widget-icon\" data-id=\"7df1aa28\" data-element_type=\"widget\" data-settings=\"{&quot;_position&quot;:&quot;absolute&quot;}\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<div class=\"elementor-icon\">\n\t\t\t<i aria-hidden=\"true\" class=\"far fa-lightbulb\"><\/i>\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-7068c951 elementor-widget elementor-widget-heading\" data-id=\"7068c951\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\">\u062a\u0648\u062c\u0647<\/h5>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-1ce37300 elementor-widget elementor-widget-text-editor\" data-id=\"1ce37300\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<p>\u0627\u06af\u0631 \u0646\u06cc\u0627\u0632 \u0628\u0647 \u0631\u0627\u0647\u0646\u0645\u0627\u06cc\u06cc \u0628\u06cc\u0634\u062a\u0631 \u0628\u0631\u0627\u06cc \u0646\u0635\u0628 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0628\u0631 \u0631\u0648\u06cc \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u062f\u0627\u0631\u06cc\u062f\u060c <a href=\"https:\/\/thecaferobot.com\/learn\/how-to-install-an-arduino-library\/\">\u0645\u06cc \u062a\u0648\u0627\u0646\u06cc\u062f \u0628\u0647 \u0622\u0645\u0648\u0632\u0634 \u0646\u0635\u0628 \u06a9\u062a\u0627\u0628\u062e\u0627\u0646\u0647 \u0628\u0631 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648<\/a> \u0645\u0631\u0627\u062c\u0639\u0647 \u06a9\u0646\u06cc\u062f.<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/section>\r\n\t\t\t\t<div class=\"elementor-element elementor-element-3b1b164e elementor-widget elementor-widget-text-editor\" data-id=\"3b1b164e\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t\u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0631\u0648\u06cc \u0628\u0631\u062f \u0622\u0631\u062f\u0648\u06cc\u0646\u0648\u06cc \u062e\u0648\u062f \u0622\u067e\u0644\u0648\u062f \u06a9\u0646\u06cc\u062f.\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-3cff516a elementor-widget elementor-widget-html\" data-id=\"3cff516a\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<pre class=\"line-numbers lang-arduino\"><code>\/*   \r\nmodified on Sep 8, 2020\r\nModified by MohammedDamirchi from https:\/\/github.com\/FastLED\/FastLED\r\nhttps:\/\/electropeak.com\/learn\/ \r\n*\/\r\n#include &lt;FastLED.h&gt;\r\n\r\n#define LED_PIN     6\r\n#define NUM_LEDS    1\r\n#define BRIGHTNESS  64\r\n#define LED_TYPE    WS2811\r\n#define COLOR_ORDER GRB\r\nCRGB leds[NUM_LEDS];\r\n\r\n#define UPDATES_PER_SECOND 100\r\n\r\n\/\/ This example shows several ways to set up and use 'palettes' of colors\r\n\/\/ with FastLED.\r\n\/\/\r\n\/\/ These compact palettes provide an easy way to re-colorize your\r\n\/\/ animation on the fly, quickly, easily, and with low overhead.\r\n\/\/\r\n\/\/ USING palettes is MUCH simpler in practice than in theory, so first just\r\n\/\/ run this sketch, and watch the pretty lights as you then read through\r\n\/\/ the code.  Although this sketch has eight (or more) different color schemes,\r\n\/\/ the entire sketch compiles down to about 6.5K on AVR.\r\n\/\/\r\n\/\/ FastLED provides a few pre-configured color palettes, and makes it\r\n\/\/ extremely easy to make up your own color schemes with palettes.\r\n\/\/\r\n\/\/ Some notes on the more abstract 'theory and practice' of\r\n\/\/ FastLED compact palettes are at the bottom of this file.\r\n\r\n\r\n\r\nCRGBPalette16 currentPalette;\r\nTBlendType    currentBlending;\r\n\r\nextern CRGBPalette16 myRedWhiteBluePalette;\r\nextern const TProgmemPalette16 myRedWhiteBluePalette_p PROGMEM;\r\n\r\n\r\nvoid setup() {\r\n    delay( 3000 ); \/\/ power-up safety delay\r\n    FastLED.addLeds&lt;LED_TYPE, LED_PIN, COLOR_ORDER&gt;(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );\r\n    FastLED.setBrightness(  BRIGHTNESS );\r\n    \r\n    currentPalette = RainbowColors_p;\r\n    currentBlending = LINEARBLEND;\r\n}\r\n\r\n\r\nvoid loop()\r\n{\r\n    ChangePalettePeriodically();\r\n    \r\n    static uint8_t startIndex = 0;\r\n    startIndex = startIndex + 1; \/* motion speed *\/\r\n    \r\n    FillLEDsFromPaletteColors( startIndex);\r\n    \r\n    FastLED.show();\r\n    FastLED.delay(1000 \/ UPDATES_PER_SECOND);\r\n}\r\n\r\nvoid FillLEDsFromPaletteColors( uint8_t colorIndex)\r\n{\r\n    uint8_t brightness = 255;\r\n    \r\n    for( int i = 0; i &lt; NUM_LEDS; i++) {\r\n        leds[i] = ColorFromPalette( currentPalette, colorIndex, brightness, currentBlending);\r\n        colorIndex += 3;\r\n    }\r\n}\r\n\r\n\r\n\/\/ There are several different palettes of colors demonstrated here.\r\n\/\/\r\n\/\/ FastLED provides several 'preset' palettes: RainbowColors_p, RainbowStripeColors_p,\r\n\/\/ OceanColors_p, CloudColors_p, LavaColors_p, ForestColors_p, and PartyColors_p.\r\n\/\/\r\n\/\/ Additionally, you can manually define your own color palettes, or you can write\r\n\/\/ code that creates color palettes on the fly.  All are shown here.\r\n\r\nvoid ChangePalettePeriodically()\r\n{\r\n    uint8_t secondHand = (millis() \/ 1000) % 60;\r\n    static uint8_t lastSecond = 99;\r\n    \r\n    if( lastSecond != secondHand) {\r\n        lastSecond = secondHand;\r\n        if( secondHand ==  0)  { currentPalette = RainbowColors_p;         currentBlending = LINEARBLEND; }\r\n        if( secondHand == 10)  { currentPalette = RainbowStripeColors_p;   currentBlending = NOBLEND;  }\r\n        if( secondHand == 15)  { currentPalette = RainbowStripeColors_p;   currentBlending = LINEARBLEND; }\r\n        if( secondHand == 20)  { SetupPurpleAndGreenPalette();             currentBlending = LINEARBLEND; }\r\n        if( secondHand == 25)  { SetupTotallyRandomPalette();              currentBlending = LINEARBLEND; }\r\n        if( secondHand == 30)  { SetupBlackAndWhiteStripedPalette();       currentBlending = NOBLEND; }\r\n        if( secondHand == 35)  { SetupBlackAndWhiteStripedPalette();       currentBlending = LINEARBLEND; }\r\n        if( secondHand == 40)  { currentPalette = CloudColors_p;           currentBlending = LINEARBLEND; }\r\n        if( secondHand == 45)  { currentPalette = PartyColors_p;           currentBlending = LINEARBLEND; }\r\n        if( secondHand == 50)  { currentPalette = myRedWhiteBluePalette_p; currentBlending = NOBLEND;  }\r\n        if( secondHand == 55)  { currentPalette = myRedWhiteBluePalette_p; currentBlending = LINEARBLEND; }\r\n    }\r\n}\r\n\r\n\/\/ This function fills the palette with totally random colors.\r\nvoid SetupTotallyRandomPalette()\r\n{\r\n    for( int i = 0; i &lt; 16; i++) {\r\n        currentPalette[i] = CHSV( random8(), 255, random8());\r\n    }\r\n}\r\n\r\n\/\/ This function sets up a palette of black and white stripes,\r\n\/\/ using code.  Since the palette is effectively an array of\r\n\/\/ sixteen CRGB colors, the various fill_* functions can be used\r\n\/\/ to set them up.\r\nvoid SetupBlackAndWhiteStripedPalette()\r\n{\r\n    \/\/ 'black out' all 16 palette entries...\r\n    fill_solid( currentPalette, 16, CRGB::Black);\r\n    \/\/ and set every fourth one to white.\r\n    currentPalette[0] = CRGB::White;\r\n    currentPalette[4] = CRGB::White;\r\n    currentPalette[8] = CRGB::White;\r\n    currentPalette[12] = CRGB::White;\r\n    \r\n}\r\n\r\n\/\/ This function sets up a palette of purple and green stripes.\r\nvoid SetupPurpleAndGreenPalette()\r\n{\r\n    CRGB purple = CHSV( HUE_PURPLE, 255, 255);\r\n    CRGB green  = CHSV( HUE_GREEN, 255, 255);\r\n    CRGB black  = CRGB::Black;\r\n    \r\n    currentPalette = CRGBPalette16(\r\n                                   green,  green,  black,  black,\r\n                                   purple, purple, black,  black,\r\n                                   green,  green,  black,  black,\r\n                                   purple, purple, black,  black );\r\n}\r\n\r\n\r\n\/\/ This example shows how to set up a static color palette\r\n\/\/ which is stored in PROGMEM (flash), which is almost always more\r\n\/\/ plentiful than RAM.  A static PROGMEM palette like this\r\n\/\/ takes up 64 bytes of flash.\r\nconst TProgmemPalette16 myRedWhiteBluePalette_p PROGMEM =\r\n{\r\n    CRGB::Red,\r\n    CRGB::Gray, \/\/ 'white' is too bright compared to red and blue\r\n    CRGB::Blue,\r\n    CRGB::Black,\r\n    \r\n    CRGB::Red,\r\n    CRGB::Gray,\r\n    CRGB::Blue,\r\n    CRGB::Black,\r\n    \r\n    CRGB::Red,\r\n    CRGB::Red,\r\n    CRGB::Gray,\r\n    CRGB::Gray,\r\n    CRGB::Blue,\r\n    CRGB::Blue,\r\n    CRGB::Black,\r\n    CRGB::Black\r\n};\r\n\r\n\r\n\r\n\/\/ Additionl notes on FastLED compact palettes:\r\n\/\/\r\n\/\/ Normally, in computer graphics, the palette (or &quot;color lookup table&quot;)\r\n\/\/ has 256 entries, each containing a specific 24-bit RGB color.  You can then\r\n\/\/ index into the color palette using a simple 8-bit (one byte) value.\r\n\/\/ A 256-entry color palette takes up 768 bytes of RAM, which on Arduino\r\n\/\/ is quite possibly &quot;too many&quot; bytes.\r\n\/\/\r\n\/\/ FastLED does offer traditional 256-element palettes, for setups that\r\n\/\/ can afford the 768-byte cost in RAM.\r\n\/\/\r\n\/\/ However, FastLED also offers a compact alternative.  FastLED offers\r\n\/\/ palettes that store 16 distinct entries, but can be accessed AS IF\r\n\/\/ they actually have 256 entries; this is accomplished by interpolating\r\n\/\/ between the 16 explicit entries to create fifteen intermediate palette\r\n\/\/ entries between each pair.\r\n\/\/\r\n\/\/ So for example, if you set the first two explicit entries of a compact \r\n\/\/ palette to Green (0,255,0) and Blue (0,0,255), and then retrieved \r\n\/\/ the first sixteen entries from the virtual palette (of 256), you'd get\r\n\/\/ Green, followed by a smooth gradient from green-to-blue, and then Blue.\r\n<\/code><\/pre>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-51bda878 elementor-widget elementor-widget-text-editor\" data-id=\"51bda878\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t\u06a9\u062f \u0632\u06cc\u0631 \u0631\u0627 \u0631\u0648\u06cc \u0628\u0631\u062f STM32 \u062e\u0648\u062f \u0622\u067e\u0644\u0648\u062f \u06a9\u0646\u06cc\u062f.\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<section class=\"elementor-section elementor-inner-section elementor-element elementor-element-592b1869 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"592b1869\" data-element_type=\"section\">\r\n\t\t\t\r\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\r\n\t\t\t\t\t\t\t\t<div class=\"elementor-row\">\r\n\t\t\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-inner-column elementor-element elementor-element-8d41b06\" data-id=\"8d41b06\" data-element_type=\"column\" data-settings=\"{&quot;background_background&quot;:&quot;gradient&quot;}\">\r\n\r\n\t\t\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\r\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\r\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-5dc98341 elementor-view-stacked elementor-widget__width-auto elementor-absolute elementor-shape-circle elementor-widget elementor-widget-icon\" data-id=\"5dc98341\" data-element_type=\"widget\" data-settings=\"{&quot;_position&quot;:&quot;absolute&quot;}\" data-widget_type=\"icon.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<div class=\"elementor-icon-wrapper\">\n\t\t\t<div class=\"elementor-icon\">\n\t\t\t<i aria-hidden=\"true\" class=\"far fa-lightbulb\"><\/i>\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-2cae4318 elementor-widget elementor-widget-heading\" data-id=\"2cae4318\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h5 class=\"elementor-heading-title elementor-size-default\">\u062a\u0648\u062c\u0647<\/h5>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-cc47c68 elementor-widget elementor-widget-text-editor\" data-id=\"cc47c68\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t\u0628\u0631\u062f \u0647\u0627\u06cc STM32 \u06a9\u0647 \u0627\u0632 \u0637\u0631\u06cc\u0642 Arduino IDE \u067e\u0631\u0648\u06af\u0631\u0627\u0645 \u0645\u06cc \u0634\u0648\u0646\u062f \u0628\u0627 LED WS2812 \u0645\u0634\u06a9\u0644 \u062f\u0627\u0631\u0646\u062f \u0648 \u0641\u0642\u0637 \u0627\u0632 \u0637\u0631\u06cc\u0642 \u067e\u06cc\u0646 PC13 \u0645\u06cc\u062a\u0648\u0627\u0646\u06cc\u062f \u0627\u06cc\u0646 \u0646\u0648\u0639 LED \u0647\u0627 \u0631\u0627 \u0631\u0648\u0634\u0646 \u06a9\u0646\u06cc\u062f.\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/section>\r\n\t\t\t\t<div class=\"elementor-element elementor-element-269cd7eb elementor-widget elementor-widget-html\" data-id=\"269cd7eb\" data-element_type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<pre class=\"line-numbers lang-arduino\"><code>\/*   \r\nmodified on Sep 8, 2020\r\nModified by MohammedDamirchi from https:\/\/github.com\/FearlessNight\/bluepill_ws2812\r\nhttps:\/\/electropeak.com\/learn\/ \r\n*\/ \r\n\/\/--------------------------------------------------------------\r\n\/\/ Blue Pill STM32F103C8 WS2812 Neopixel driver example\r\n\/\/ Color Wheel display\r\n\/\/ Connect WS2812 LED string to pin PC13 (use level up-shifter)\r\n\r\n#include &quot;bluepill_ws2812.h&quot;\r\nbluepill_neopixel PIX;       \/\/ a string of pixels\r\n#define NUM_PIXELS 1     \/\/   number of pixels in the string\r\npixel string[NUM_PIXELS]; \/\/   rgb data buffer\r\n#define string_port GPIOC \/\/   pin string is connected to\r\n#define string_pin  13\r\n\r\n\/\/ RGB color wheel\r\nvoid wheel( pixel *p, uint8_t w )\r\n{\r\n  if(w &lt; 85)\r\n  { p-&gt;rgb.r = 255 - w * 3;\r\n    p-&gt;rgb.g = 0;\r\n    p-&gt;rgb.b = w * 3;\r\n  }\r\n  else if(w &lt; 170)\r\n  { w -= 85;\r\n    p-&gt;rgb.r = 0;\r\n    p-&gt;rgb.g = w * 3;\r\n    p-&gt;rgb.b = 255 - w * 3;\r\n  }\r\n  else\r\n  { w -= 170;\r\n    p-&gt;rgb.r = w * 3;\r\n    p-&gt;rgb.g = 255 - w * 3;\r\n    p-&gt;rgb.b = 0;\r\n  }\r\n}\r\n\r\n\/\/ dim pixel down\r\nvoid attenuate( pixel *p, uint8_t factor )\r\n{\r\n  p-&gt;rgb.r \/= factor;\r\n  p-&gt;rgb.g \/= factor;\r\n  p-&gt;rgb.b \/= factor;\r\n}\r\n\r\nvoid setup() \r\n{\r\n  PIX.begin(string_port, string_pin); \/\/ set pin to output\r\n}\r\n\r\nvoid loop()\r\n{\r\n  static uint8_t wheel_index = 0; \/\/ color wheel\r\n\r\n  \/\/ fill pixel buffer\r\n  for (uint8_t i=0; i &lt; NUM_PIXELS; i++)\r\n  { wheel( &amp;string[i], wheel_index + i*(256\/NUM_PIXELS) );  \r\n    attenuate( &amp;string[i], 8 );\r\n  } \r\n  \r\n  \/\/ output pixel buffer to string  \r\n  PIX.paint( string[0].bytes, NUM_PIXELS, string_port, string_pin );\r\n\r\n  \/\/ loop\r\n  wheel_index++;\r\n  delay(10);\r\n} \r\n  Serial.println(&quot; &quot;);delay(100); delay(100);   delay(100);  Serialrial  }\r\n<\/code><\/pre>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t\t\t<\/div>\r\n\t\t\t\t\t<\/div>\r\n\t\t\t\t<\/section>\r\n\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>\u0648\u06cc\u0698\u06af\u06cc \u0647\u0627\u06cc \u0645\u0627\u0698\u0648\u0644 WS2812 &#8211; LED RGB \u0645\u0627\u0698\u0648\u0644 WS2812 \u06cc\u06a9 \u0627\u0644 \u0627\u06cc \u062f\u06cc RGB \u0627\u0633\u062a. \u0627\u06cc\u0646 \u0645\u0627\u0698\u0648\u0644 \u0628\u0631 \u0631\u0648\u06cc \u062e\u0648\u062f \u06cc\u06a9 \u0639\u062f\u062f LED RGB \u067e\u0646\u062c \u0645\u06cc\u0644\u06cc \u0645\u062a\u0631\u06cc \u0631\u0627 \u0628\u0631\u0631\u0648\u06cc \u062e\u0648\u062f \u062f\u0627\u0631\u062f \u06a9\u0647 \u0642\u0627\u0628\u0644\u06cc\u062a \u0627\u06cc\u062c\u0627\u062f 16777216 \u0631\u0646\u06af \u0631\u0627 \u062f\u0627\u0631\u0627\u0633\u062a. \u0645\u0639\u0631\u0641\u06cc \u067e\u0627\u06cc\u0647 \u0647\u0627 (Pinout) \u0645\u0627\u0698\u0648\u0644 \u0627\u0644 \u0627\u06cc \u062f\u06cc WS2812 RGB \u0645\u0627\u0698\u0648\u0644 \u0627\u0644 \u0627\u06cc \u062f\u06cc WS2812 RGB \u062f\u0627\u0631\u0627\u06cc [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":19962,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[942],"tags":[4619],"platform":[1071],"bytype":[1075],"difficulty":[1077],"related_products":[3863],"featured_image_src":{"landsacpe":["https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/sen-11-033-teaser.jpg",1200,900,false],"list":["https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/sen-11-033-teaser.jpg",1200,900,false],"medium":["https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/sen-11-033-teaser.jpg",533,400,false],"full":["https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/sen-11-033-teaser.jpg",1200,900,false]},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v14.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u0622\u0645\u0648\u0632\u0634 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u0627\u0698\u0648\u0644 LED RGB WS2812 \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 - \u06a9\u0627\u0641\u0647 \u0631\u0628\u0627\u062a<\/title>\n<meta name=\"description\" content=\"\u062f\u0631 \u0622\u0645\u0648\u0632\u0634 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u0627\u0698\u0648\u0644 WS2812 - LED RGB \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0648 STM32 \u06cc\u0627\u062f \u0645\u06cc\u200c\u06af\u06cc\u0631\u06cc\u062f \u0686\u06af\u0648\u0646\u0647 \u0627\u0632 \u0645\u0627\u0698\u0648\u0644 WS2812 \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f \u0628\u0647 \u0647\u0645\u0631\u0627\u0647 \u0645\u062b\u0627\u0644\" \/>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/\" \/>\n<meta property=\"og:locale\" content=\"fa_IR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0622\u0645\u0648\u0632\u0634 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u0627\u0698\u0648\u0644 LED RGB WS2812 \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 - \u06a9\u0627\u0641\u0647 \u0631\u0628\u0627\u062a\" \/>\n<meta property=\"og:description\" content=\"\u062f\u0631 \u0622\u0645\u0648\u0632\u0634 \u0631\u0627\u0647 \u0627\u0646\u062f\u0627\u0632\u06cc \u0645\u0627\u0698\u0648\u0644 WS2812 - LED RGB \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0648 STM32 \u06cc\u0627\u062f \u0645\u06cc\u200c\u06af\u06cc\u0631\u06cc\u062f \u0686\u06af\u0648\u0646\u0647 \u0627\u0632 \u0645\u0627\u0698\u0648\u0644 WS2812 \u0628\u0627 \u0622\u0631\u062f\u0648\u06cc\u0646\u0648 \u0627\u0633\u062a\u0641\u0627\u062f\u0647 \u06a9\u0646\u06cc\u062f \u0628\u0647 \u0647\u0645\u0631\u0627\u0647 \u0645\u062b\u0627\u0644\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/\" \/>\n<meta property=\"og:site_name\" content=\"\u06a9\u0627\u0641\u0647 \u0631\u0628\u0627\u062a\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-01T13:22:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-29T09:00:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/sen-11-033-teaser.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/thecaferobot.com\/learn\/#organization\",\"name\":\"\\u06a9\\u0627\\u0641\\u0647 \\u0631\\u0628\\u0627\\u062a\",\"url\":\"https:\/\/thecaferobot.com\/learn\/\",\"sameAs\":[],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/thecaferobot.com\/learn\/#logo\",\"inLanguage\":\"fa-IR\",\"url\":\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2018\/08\/Logo-small.png\",\"width\":250,\"height\":250,\"caption\":\"\\u06a9\\u0627\\u0641\\u0647 \\u0631\\u0628\\u0627\\u062a\"},\"image\":{\"@id\":\"https:\/\/thecaferobot.com\/learn\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/thecaferobot.com\/learn\/#website\",\"url\":\"https:\/\/thecaferobot.com\/learn\/\",\"name\":\"\\u06a9\\u0627\\u0641\\u0647 \\u0631\\u0628\\u0627\\u062a\",\"description\":\"\\u0622\\u0645\\u0648\\u0632\\u0634 \\u0627\\u0644\\u06a9\\u062a\\u0631\\u0648\\u0646\\u06cc\\u06a9\\u060c \\u0631\\u0628\\u0627\\u062a\\u06cc\\u06a9\\u060c \\u0622\\u0631\\u062f\\u0648\\u06cc\\u0646\\u0648 \\u0648 \\u0631\\u0633\\u067e\\u0628\\u0631\\u06cc \\u067e\\u0627\\u06cc\",\"publisher\":{\"@id\":\"https:\/\/thecaferobot.com\/learn\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/thecaferobot.com\/learn\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"fa-IR\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/#primaryimage\",\"inLanguage\":\"fa-IR\",\"url\":\"https:\/\/thecaferobot.com\/learn\/wp-content\/uploads\/2020\/11\/sen-11-033-teaser.jpg\",\"width\":1200,\"height\":900},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/#webpage\",\"url\":\"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/\",\"name\":\"\\u0622\\u0645\\u0648\\u0632\\u0634 \\u0631\\u0627\\u0647 \\u0627\\u0646\\u062f\\u0627\\u0632\\u06cc \\u0645\\u0627\\u0698\\u0648\\u0644 LED RGB WS2812 \\u0628\\u0627 \\u0622\\u0631\\u062f\\u0648\\u06cc\\u0646\\u0648 - \\u06a9\\u0627\\u0641\\u0647 \\u0631\\u0628\\u0627\\u062a\",\"isPartOf\":{\"@id\":\"https:\/\/thecaferobot.com\/learn\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/#primaryimage\"},\"datePublished\":\"2020-12-01T13:22:36+00:00\",\"dateModified\":\"2023-05-29T09:00:52+00:00\",\"description\":\"\\u062f\\u0631 \\u0622\\u0645\\u0648\\u0632\\u0634 \\u0631\\u0627\\u0647 \\u0627\\u0646\\u062f\\u0627\\u0632\\u06cc \\u0645\\u0627\\u0698\\u0648\\u0644 WS2812 - LED RGB \\u0628\\u0627 \\u0622\\u0631\\u062f\\u0648\\u06cc\\u0646\\u0648 \\u0648 STM32 \\u06cc\\u0627\\u062f \\u0645\\u06cc\\u200c\\u06af\\u06cc\\u0631\\u06cc\\u062f \\u0686\\u06af\\u0648\\u0646\\u0647 \\u0627\\u0632 \\u0645\\u0627\\u0698\\u0648\\u0644 WS2812 \\u0628\\u0627 \\u0622\\u0631\\u062f\\u0648\\u06cc\\u0646\\u0648 \\u0627\\u0633\\u062a\\u0641\\u0627\\u062f\\u0647 \\u06a9\\u0646\\u06cc\\u062f \\u0628\\u0647 \\u0647\\u0645\\u0631\\u0627\\u0647 \\u0645\\u062b\\u0627\\u0644\",\"inLanguage\":\"fa-IR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/\"]}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/#webpage\"},\"author\":{\"@id\":\"https:\/\/thecaferobot.com\/learn\/#\/schema\/person\/391776cde87ca107a152ca4dd9440a54\"},\"headline\":\"\\u0622\\u0645\\u0648\\u0632\\u0634 \\u0631\\u0627\\u0647 \\u0627\\u0646\\u062f\\u0627\\u0632\\u06cc \\u0645\\u0627\\u0698\\u0648\\u0644 LED RGB WS2812 \\u0628\\u0627 \\u0622\\u0631\\u062f\\u0648\\u06cc\\u0646\\u0648\",\"datePublished\":\"2020-12-01T13:22:36+00:00\",\"dateModified\":\"2023-05-29T09:00:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/#webpage\"},\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/thecaferobot.com\/learn\/#organization\"},\"image\":{\"@id\":\"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/#primaryimage\"},\"keywords\":\"\\u0646\\u0648\\u0631\",\"articleSection\":\"\\u0646\\u0648\\u0631 \\u0648 \\u0631\\u0648\\u0634\\u0646\\u0627\\u06cc\\u06cc\",\"inLanguage\":\"fa-IR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/thecaferobot.com\/learn\/interfacing-ws2812-led-rgb-color-module-with-arduino\/#respond\"]}]},{\"@type\":[\"Person\"],\"@id\":\"https:\/\/thecaferobot.com\/learn\/#\/schema\/person\/391776cde87ca107a152ca4dd9440a54\",\"name\":\"\\u0645\\u062d\\u0645\\u062f \\u062f\\u0645\\u06cc\\u0631\\u0686\\u06cc\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/thecaferobot.com\/learn\/#personlogo\",\"inLanguage\":\"fa-IR\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/831b2d5977ac9997b6a7e78dc61cfd45?s=96&d=mm&r=g\",\"caption\":\"\\u0645\\u062d\\u0645\\u062f \\u062f\\u0645\\u06cc\\u0631\\u0686\\u06cc\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","_links":{"self":[{"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/posts\/19961"}],"collection":[{"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/comments?post=19961"}],"version-history":[{"count":8,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/posts\/19961\/revisions"}],"predecessor-version":[{"id":28204,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/posts\/19961\/revisions\/28204"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/media\/19962"}],"wp:attachment":[{"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/media?parent=19961"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/categories?post=19961"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/tags?post=19961"},{"taxonomy":"platform","embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/platform?post=19961"},{"taxonomy":"bytype","embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/bytype?post=19961"},{"taxonomy":"difficulty","embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/difficulty?post=19961"},{"taxonomy":"related_products","embeddable":true,"href":"https:\/\/thecaferobot.com\/learn\/wp-json\/wp\/v2\/related_products?post=19961"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}