{"id":42,"date":"2025-10-03T15:34:03","date_gmt":"2025-10-03T15:34:03","guid":{"rendered":"https:\/\/theroyalscode.com\/students\/a_mehraban\/?page_id=42"},"modified":"2025-10-03T15:34:03","modified_gmt":"2025-10-03T15:34:03","slug":"making-led-date10-3-25","status":"publish","type":"page","link":"https:\/\/theroyalscode.com\/students\/a_mehraban\/making-led-date10-3-25\/","title":{"rendered":"Making LED       Date10\/3\/25"},"content":{"rendered":"\n<p>Today i made LED light <\/p>\n\n\n\n<p>I code it first <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Write your code here :-)\nfrom lib import neopixel\nimport board\nimport time\n\npin = board.GP22\nnum_pixels = 9\n\npixels = neopixel.NeoPixel(pin, num_pixels, brightness=0.3, auto_write=True)\n\n\nRED = (255, 0, 0)\nGREEN = (0, 255, 0)\nBLUE = (0, 0, 255)\nPINK = (247, 0, 255)\nGRAY = (152, 169, 171)\nBROWN = (138, 62, 4)\nORANGE = (255, 123, 0)\nSHER = (4, 217, 139)\nBLACK = (0,0,0)\noffset = 1\nwhile True:\n    pixels.fill(BLACK)\n    pixels&#91;(0 + offset)%num_pixels] = BLUE\n    pixels&#91;(1 + offset)%num_pixels] = GREEN\n    pixels&#91;(2 + offset)%num_pixels] = PINK\n    pixels&#91;(3 + offset)%num_pixels] = GRAY\n    pixels&#91;(4 + offset)%num_pixels] = BROWN              \n    pixels&#91;(6 + offset)%num_pixels] = ORANGE\n    pixels&#91;(7 + offset)%num_pixels] = SHER\n    pixels&#91;(8 + offset)%num_pixels] = RED\n    time.sleep(0.2)\n    offset += 1\n<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1080\" style=\"aspect-ratio: 1920 \/ 1080;\" width=\"1920\" controls src=\"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-content\/uploads\/2025\/10\/1000016273-1.mp4\"><\/video><\/figure>\n\n\n\n<p>What this code dose ______  pixels[(0 + offset)%num_pixels] = BLUE<br>pixels[(1 + offset)%num_pixels] = GREEN<br>pixels[(2 + offset)%num_pixels] = PINK<br>pixels[(3 + offset)%num_pixels] = GRAY<br>pixels[(4 + offset)%num_pixels] = BROWN<br>pixels[(6 + offset)%num_pixels] = ORANGE<br>pixels[(7 + offset)%num_pixels] = SHER<br>pixels[(8 + offset)%num_pixels] = RED<br>time.sleep(0.2)<br>offset += 1<\/p>\n\n\n\n<p>by this we can move the LED or light <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today i made LED light I code it first What this code dose ______ pixels[(0 + offset)%num_pixels] = BLUEpixels[(1 + [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-42","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/pages\/42","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/comments?post=42"}],"version-history":[{"count":1,"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/pages\/42\/revisions"}],"predecessor-version":[{"id":44,"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/pages\/42\/revisions\/44"}],"wp:attachment":[{"href":"https:\/\/theroyalscode.com\/students\/a_mehraban\/wp-json\/wp\/v2\/media?parent=42"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}