{"id":1499,"date":"2020-03-30T10:57:42","date_gmt":"2020-03-30T08:57:42","guid":{"rendered":"http:\/\/www.ardpylab.fr\/?page_id=1499"},"modified":"2020-05-10T15:00:28","modified_gmt":"2020-05-10T13:00:28","slug":"dipoles-rc-activite-5","status":"publish","type":"page","link":"https:\/\/www.ardpylab.fr\/?page_id=1499","title":{"rendered":"Dip\u00f4les RC &#8211; Activit\u00e9 5"},"content":{"rendered":"\n<h2 style=\"text-align: center;\"><em>\u201d <\/em><span style=\"text-decoration: underline;\"><em>R\u00e9aliser un flash p\u00e9riodique<\/em><\/span> <em>\u201d<\/em><\/h2>\n\n\n\n<p>&nbsp;<\/p>\n<h4><span style=\"color: #3366ff;\"><strong>. <span style=\"text-decoration: underline;\">Objectif<\/span><\/strong><\/span><\/h4>\n<p>Dans cette activit\u00e9, nous allons modifier le programme de l\u2019activit\u00e9 pr\u00e9c\u00e9dente (<a href=\"https:\/\/www.ardpylab.fr\/?page_id=1441\/#anc3\" data-wplink-url-error=\"true\">circuit identique<\/a>) pour que le flash s\u2019effectue p\u00e9riodiquement apr\u00e8s avoir appuy\u00e9 sur le bouton poussoir.<\/p>\n\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1482 aligncenter\" style=\"border: 3px solid #eeeeee; padding: 3px; margin: 3px;\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/rc-circuit4e.png\" alt=\"\" width=\"571\" height=\"326\"><\/figure>\n<\/div>\n\n\n\n<p><br>Pour cela, il suffit de surveiller, en boucle, la tension Uc aux bornes du condensateur de fa\u00e7on \u00e0 alterner entre la charge et la d\u00e9charge&nbsp;:<\/p>\n<p style=\"padding-left: 40px;\">&#8211; Si Uc est sup\u00e9rieure \u00e0 une valeur <strong>Uc max<\/strong> \u00e0 d\u00e9finir, le condensateur est d\u00e9charg\u00e9, ce qui produit un flash.<\/p>\n<p style=\"padding-left: 40px;\">&#8211; Si Uc est inf\u00e9rieure \u00e0 une valeur <strong>Uc min<\/strong> \u00e0 d\u00e9finir, le condensateur est charg\u00e9 jusqu\u2019\u00e0 <strong>Uc max<\/strong>, puis le condensateur est d\u00e9charg\u00e9 jusqu\u2019\u00e0 Uc min et ainsi de suite\u2026<\/p>\n<p>Le flash p\u00e9riodique est arr\u00eat\u00e9 en appuyant de nouveau sur le bouton poussoir.<\/p>\n\n\n\n<h4>&nbsp;<\/h4>\n<h4><span style=\"color: #3366ff;\"><strong>. <span style=\"text-decoration: underline;\">Le programme<\/span><\/strong><\/span><\/h4>\n<p>Voici <a href=\"https:\/\/www.ardpylab.fr\/downloads\/circuit-rc\/activity5.zip\" data-wplink-url-error=\"true\">le code de l\u2019activit\u00e9<\/a>, dont il sera possible de modifier les constantes <strong>UcMax<\/strong> et <strong>UcMin<\/strong> pour voir l\u2019influence sur la p\u00e9riode des flashs&nbsp;:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.ardpylab.fr\/downloads\/circuit-rc\/Activity5\/Activity5.ino\"><img loading=\"lazy\" decoding=\"async\" width=\"539\" height=\"646\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/rc-code5.png\" alt=\"\" class=\"wp-image-1503\" srcset=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/rc-code5.png 539w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/rc-code5-250x300.png 250w\" sizes=\"auto, (max-width: 539px) 100vw, 539px\" \/><\/a><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.ardpylab.fr\/downloads\/circuit-rc\/Activity5\/Activity5.ino\"><img decoding=\"async\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/rc-code5b.png\" alt=\"\" class=\"wp-image-1504\"\/><\/a><\/figure>\n\n\n\n<p><strong><u><br>D\u00e9roulement du programme<\/u><\/strong><strong>&nbsp;:<\/strong><\/p>\n<p>&#8211; 1. D\u00e9claration des constantes et variables&nbsp;:<\/p>\n<p style=\"padding-left: 40px;\">. <strong>const int PinUc = 0<\/strong> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (broche du condensateur&nbsp;: A0)<\/p>\n<p style=\"padding-left: 40px;\"><strong>. const int PinButton = 12<\/strong>&nbsp; &nbsp; &nbsp; (broche du bouton poussoir)<\/p>\n<p style=\"padding-left: 40px;\"><strong>. const int PinRelay = 2<\/strong>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (broche du relais)<\/p>\n<p style=\"padding-left: 40px;\"><strong>. const int UcMax = 1000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong>(valeur maximale de la broche du condensateur)<\/p>\n<p style=\"padding-left: 40px;\"><strong>. const int UcMin = 800&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <\/strong>(valeur minimale de la broche du condensateur)<\/p>\n<p style=\"padding-left: 40px;\">.&nbsp;<strong>int ValPinUc = 0&nbsp;<\/strong>&nbsp; &nbsp;(variable nombre entier pour stocker la valeur de la broche du condensateur)<\/p>\n<p style=\"padding-left: 40px;\"><strong>&nbsp;int ValButton = 0&nbsp; &nbsp;<\/strong>(variable nombre entier pour stocker la valeur de la broche du bouton poussoir)<\/p>\n<p style=\"padding-left: 40px;\"><strong>. int OldValButton = 0<\/strong>&nbsp; &nbsp; (variable nombre entier pour stocker la valeur pr\u00e9c\u00e9dente de la broche du bouton poussoir)<\/p>\n<p style=\"padding-left: 40px;\"><strong>. int State = 0&nbsp; &nbsp;&nbsp;<\/strong>(variable nombre entier correspondant \u00e0 l\u2019action \u00e0 effectuer)<\/p>\n<p style=\"padding-left: 40px;\"><strong>. int OldState = 0&nbsp; &nbsp;<\/strong>(variable nombre entier correspondant \u00e0 l\u2019action effectu\u00e9e pr\u00e9c\u00e9demment)<br><br><\/p>\n<p>&#8211; 2. Initialisation des entr\u00e9es et sorties&nbsp;:<\/p>\n<p style=\"padding-left: 40px;\"><strong>. Initialisation de la broche du relais en sortie,<\/strong><\/p>\n<p style=\"padding-left: 40px;\"><strong>. Initialisation de la broche du bouton poussoir en entr\u00e9e,<\/strong><\/p>\n<p style=\"padding-left: 40px;\"><strong>. Charge du condensateur jusqu\u2019\u00e0 UcMax.<br><br><\/strong><\/p>\n<p>&#8211; 3. Fonction principale en boucle&nbsp;:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/rc-algo5-765x1024.png\" alt=\"\" class=\"wp-image-1508\" width=\"762\" height=\"1020\" srcset=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/rc-algo5-765x1024.png 765w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/rc-algo5-224x300.png 224w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/rc-algo5-768x1027.png 768w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/rc-algo5-1148x1536.png 1148w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/rc-algo5-1531x2048.png 1531w\" sizes=\"auto, (max-width: 762px) 100vw, 762px\" \/><\/figure>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<\/p>\n\n\n<div  class=\"grids-section grids-is-stretch\" 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:2;--_gs-rows:1\"><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<div class=\"wp-block-image\"><figure class=\"alignleft size-large\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1441\"><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><\/div>\n\n<\/div>\n\n<div class=\"grids-area\" style=\"--_ga-column:2\/3;--_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<div class=\"wp-block-image\"><figure class=\"alignright size-large\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=266\"><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><\/div>\n\n<\/div>\n<\/div><\/div>\n\n\n\n","protected":false},"excerpt":{"rendered":"<p>\u201d R\u00e9aliser un flash p\u00e9riodique \u201d &nbsp; . Objectif Dans cette activit\u00e9, nous allons modifier le programme de l\u2019activit\u00e9 pr\u00e9c\u00e9dente (circuit identique) pour que le flash s\u2019effectue p\u00e9riodiquement apr\u00e8s avoir appuy\u00e9 sur le bouton poussoir. Pour cela, il suffit de surveiller, en boucle, la tension Uc aux bornes du condensateur de fa\u00e7on \u00e0 alterner entre [&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-1499","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/pages\/1499","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=1499"}],"version-history":[{"count":0,"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/pages\/1499\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}