{"id":5985,"date":"2021-03-29T16:22:16","date_gmt":"2021-03-29T14:22:16","guid":{"rendered":"https:\/\/www.ardpylab.fr\/?page_id=5985"},"modified":"2021-04-07T09:50:03","modified_gmt":"2021-04-07T07:50:03","slug":"categorie-del-rvb","status":"publish","type":"page","link":"https:\/\/www.ardpylab.fr\/?page_id=5985","title":{"rendered":"Cat\u00e9gorie \u00ab DEL RVB \u00bb"},"content":{"rendered":"\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"331\" height=\"325\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2021\/03\/ListeSketch02.png\" alt=\"\" class=\"wp-image-5986\" srcset=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2021\/03\/ListeSketch02.png 331w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2021\/03\/ListeSketch02-300x295.png 300w\" sizes=\"auto, (max-width: 331px) 100vw, 331px\" \/><\/figure><\/div>\n\n\n\n<h4>\u00a0<\/h4>\n<h4><strong>1. <a href=\"https:\/\/www.ardpylab.fr\/downloads\/ardpylog\/DELRVBSyntheseadditive.zip\"><span style=\"text-decoration: underline;\">DEL_RVB_Synthese_additive<\/span><\/a><\/strong><\/h4>\n<p>\u00a0<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2021\/03\/DEL_RVB_Synthese_additive.jpg\" alt=\"\" class=\"wp-image-5987\" width=\"468\" height=\"283\" srcset=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2021\/03\/DEL_RVB_Synthese_additive.jpg 935w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2021\/03\/DEL_RVB_Synthese_additive-300x181.jpg 300w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2021\/03\/DEL_RVB_Synthese_additive-768x464.jpg 768w\" sizes=\"auto, (max-width: 468px) 100vw, 468px\" \/><\/figure><\/div>\n\n\n\n<p>&nbsp;<\/p>\n<p>Dans cette activit\u00e9, nous allons utiliser 3 potentiom\u00e8tres respectivement connect\u00e9s aux entr\u00e9es analogiques A2, A1 et A0 de l\u2019Arduino pour r\u00e9gler les luminosit\u00e9s des DELs Rouge, Verte et Bleue d\u2019une DEL RVB \u00e0 cathode commune.<\/p>\n<p>En effet, une DEL RVB \u00e0 cathode commune dispose de 4 broches, 1 cathode et 3 anodes. Chaque anode correspond \u00e0 une couleur (Rouge, Vert et Bleu).<\/p>\n<p>En modulant les signaux sur les anodes, il est possible d\u2019obtenir de multiples couleurs avec la DEL RVB.<br>C\u2019est le principe de la synth\u00e8se additive des couleurs des pixels des \u00e9crans d\u2019ordinateur ou de t\u00e9l\u00e9vision.<\/p>\n<p>Le code de l\u2019activit\u00e9 permet :<\/p>\n<p>\u2013 Dans un premier temps, d\u2019allumer la DEL RVB en appuyant sur le bouton poussoir,<\/p>\n<p>\u2013 de faire varier la luminosit\u00e9 des DELs en fonction de la tension des entr\u00e9es A2, A1 et A0,<\/p>\n<p>\u2013 d\u2019\u00e9teindre la DEL RVB en appuyant de nouveau sur le bouton poussoir.<br><br><\/p>\n<table style=\"border-collapse: collapse; width: 100%;\">\n<tbody>\n<tr>\n<td style=\"width: 100%; padding-left: 40px;\">\n<p>\/\/ D\u00e9claration des constantes et variables<\/p>\n<p>const int PinLEDR = 11;<br>const int PinLEDB = 10;<br>const int PinLEDV = 9;<br>const int PinPOTR = A2;<br>const int PinPOTB = A0;<br>const int PinPOTV = A1;<br>const int PinButton = 12;<\/p>\n<p>int ValButton = 0;<br>int OldValButton = 0;<br>int State = 0;<\/p>\n<p>int BrightnessR = 0;<br>int BrightnessB = 0;<br>int BrightnessV = 0;<\/p>\n<p><br>\/\/ Initialisation des entr\u00e9es et sorties<\/p>\n<p>void setup() { <br>pinMode (PinLEDR, OUTPUT);<br>pinMode (PinLEDB, OUTPUT);<br>pinMode (PinLEDV, OUTPUT);<br>pinMode (PinButton, INPUT);<br>}<\/p>\n<p><br>\/\/ Fonction principale en boucle<\/p>\n<p>void loop() { <br>ValButton = digitalRead(PinButton);<br>delay(10);<br>if ((ValButton == HIGH) &amp;&amp; (OldValButton == LOW)) {<br>State=1-State; <br>}<br>OldValButton = ValButton;<br>if (State == 1) { <br>BrightnessR = analogRead(PinPOTR);<br>BrightnessB = analogRead(PinPOTB);<br>BrightnessV = analogRead(PinPOTV);<br>analogWrite(PinLEDR, 255 &#8211; BrightnessR\/4);<br>analogWrite(PinLEDB, 255 &#8211; BrightnessB\/4);<br>analogWrite(PinLEDV, 255 &#8211; BrightnessV\/4); <br>}<br>else {<br>analogWrite(PinLEDR, 0);<br>analogWrite(PinLEDB, 0);<br>analogWrite(PinLEDV, 0);<br>}<br>}<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n\n\n\n<p>\u00a0<\/p>\n<p>\u00a0 \u00a0<\/p>\n\n\n<div  class=\"grids-section grids-is-advanced\" style=\"--_gs-gap-desktop:0px 0px;--_gs-m-desktop:0 0 0 0;--_gs-p-desktop:0 0 0 0;--_gs-bg-desktop:transparent none;--_gs-bg-xp-desktop:0px;--_gs-zi-desktop:auto;--_gs-d-desktop:block;--_gs-mw-desktop:calc(100% - 0 - 0);--_gs-gap-tablet:0px 0px;--_gs-m-tablet:0 0 0 0;--_gs-p-tablet:0 0 0 0;--_gs-bg-tablet:transparent none;--_gs-bg-xp-tablet:0px;--_gs-zi-tablet:auto;--_gs-d-tablet:block;--_gs-mw-tablet:calc(100% - 0 - 0);--_gs-gap-mobile:0px 0px;--_gs-m-mobile:0 0 0 0;--_gs-p-mobile:0 0 0 0;--_gs-bg-mobile:transparent none;--_gs-bg-xp-mobile:0px;--_gs-zi-mobile:auto;--_gs-d-mobile:block;--_gs-mw-mobile:calc(100% - 0 - 0);--_gs-columns:12;--_gs-rows:6\"><div class=\"grids-s-w_i\">\n<div class=\"grids-area\" style=\"--_ga-column:1\/2;--_ga-row:1\/2;--_ga-m-desktop:0 0 0 0;--_ga-p-desktop:0 0 0 0;--_ga-bg-desktop:transparent none;--_ga-zi-desktop:auto;--_ga-d-desktop:flex;--_ga-mw-desktop:calc(100% - 0 - 0);--_ga-m-tablet:0 0 0 0;--_ga-p-tablet:0 0 0 0;--_ga-bg-tablet:transparent none;--_ga-zi-tablet:auto;--_ga-d-tablet:flex;--_ga-mw-tablet:calc(100% - 0 - 0);--_ga-m-mobile:0 0 0 0;--_ga-p-mobile:0 0 0 0;--_ga-bg-mobile:transparent none;--_ga-zi-mobile:auto;--_ga-d-mobile:flex;--_ga-mw-mobile:calc(100% - 0 - 0)\">\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=5950\"><img loading=\"lazy\" decoding=\"async\" width=\"50\" height=\"28\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/moins.jpg\" alt=\"\" class=\"wp-image-107\"\/><\/a><\/figure>\n\n<\/div>\n\n<div class=\"grids-area\" style=\"--_ga-column:12\/13;--_ga-row:1\/2;--_ga-m-desktop:0 0 0 0;--_ga-p-desktop:0 0 0 0;--_ga-bg-desktop:transparent none;--_ga-zi-desktop:auto;--_ga-d-desktop:flex;--_ga-mw-desktop:calc(100% - 0 - 0);--_ga-m-tablet:0 0 0 0;--_ga-p-tablet:0 0 0 0;--_ga-bg-tablet:transparent none;--_ga-zi-tablet:auto;--_ga-d-tablet:flex;--_ga-mw-tablet:calc(100% - 0 - 0);--_ga-m-mobile:0 0 0 0;--_ga-p-mobile:0 0 0 0;--_ga-bg-mobile:transparent none;--_ga-zi-mobile:auto;--_ga-d-mobile:flex;--_ga-mw-mobile:calc(100% - 0 - 0)\">\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=6012\"><img loading=\"lazy\" decoding=\"async\" width=\"50\" height=\"28\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/plus.jpg\" alt=\"\" class=\"wp-image-106\"\/><\/a><\/figure>\n\n<\/div>\n<\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>\u00a0 1. DEL_RVB_Synthese_additive \u00a0 &nbsp; Dans cette activit\u00e9, nous allons utiliser 3 potentiom\u00e8tres respectivement connect\u00e9s aux entr\u00e9es analogiques A2, A1 et A0 de l\u2019Arduino pour r\u00e9gler les luminosit\u00e9s des DELs Rouge, Verte et Bleue d\u2019une DEL RVB \u00e0 cathode commune. En effet, une DEL RVB \u00e0 cathode commune dispose de 4 broches, 1 cathode et [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-5985","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/pages\/5985","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5985"}],"version-history":[{"count":10,"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/pages\/5985\/revisions"}],"predecessor-version":[{"id":6261,"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/pages\/5985\/revisions\/6261"}],"wp:attachment":[{"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5985"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}