{"id":1533,"date":"2020-03-30T17:30:34","date_gmt":"2020-03-30T15:30:34","guid":{"rendered":"http:\/\/www.ardpylab.fr\/?page_id=1533"},"modified":"2020-05-10T16:54:26","modified_gmt":"2020-05-10T14:54:26","slug":"les-bases-de-la-programmation","status":"publish","type":"page","link":"https:\/\/www.ardpylab.fr\/?page_id=1533","title":{"rendered":"Les bases de la programmation"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"176\" src=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/logo-prog-1024x176.png\" alt=\"\" class=\"wp-image-1569\" srcset=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/logo-prog-1024x176.png 1024w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/logo-prog-300x52.png 300w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/logo-prog-768x132.png 768w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/logo-prog-1536x264.png 1536w, https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/03\/logo-prog-2048x352.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h6>&nbsp;<\/h6>\n<h6><span style=\"color: #999999;\">(<em>Cliquez pour afficher la version PDF)<\/em><\/span><\/h6>\n\n\n\n<div class=\"wp-block-file\"><a href=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/bases-programmation.pdf\">Les bases de la programmation<\/a><a href=\"https:\/\/www.ardpylab.fr\/wp-content\/uploads\/2020\/04\/bases-programmation.pdf\" class=\"wp-block-file__button\" download>T\u00e9l\u00e9charger<\/a><\/div>\n\n\n\n<p>&nbsp;<\/p>\n<p>Les programmes en langage Arduino, bas\u00e9 sur les langages C\/C++, peuvent \u00eatre divis\u00e9s en trois parties principales : la structure, les valeurs (variables et constantes) et les fonctions.<\/p>\n<h4>&nbsp;<\/h4>\n\n\n\n<h4><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563\"><span style=\"color: #3366ff;\"><strong>1. <span style=\"text-decoration: underline;\">Structure du programme<\/span><\/strong><\/span><\/a><br><br><\/h4>\n<p style=\"padding-left: 40px;\"><span style=\"color: #000000;\"><a style=\"color: #000000;\" href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure1\"><strong>1.1. Syntaxe de base<\/strong><\/a><\/span><\/p>\n<p style=\"padding-left: 80px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure1\">. Le point-virgule ;<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure11\">. Les accolades {}<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure12\"><strong>. \/\/ <\/strong>Les commentaires<\/a><\/p>\n<p style=\"padding-left: 40px;\"><span style=\"color: #000000;\"><strong><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure2\"><span style=\"color: #000000;\">1.2. Les op\u00e9rateurs arithm\u00e9tiques<\/span><\/a><\/strong><\/span><\/p>\n<p style=\"padding-left: 80px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure2\">. op\u00e9rateur d&rsquo;assignement (signe \u00e9gal unique) =<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure21\">. Addition + , Soustraction &#8211; , Multiplication * , et Division \/<\/a><\/p>\n<p style=\"padding-left: 40px;\"><span style=\"color: #000000;\"><a style=\"color: #000000;\" href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure3\"><strong>1.3. Les op\u00e9rateurs de comparaison (==, !=, &lt;, &gt;)<\/strong><\/a><\/span><\/p>\n<p style=\"padding-left: 40px;\"><span style=\"color: #000000;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure4\"><strong><span style=\"color: #000000;\">1.4. Les op\u00e9rateurs bool\u00e9ens<\/span><\/strong><\/a><\/span><\/p>\n<p style=\"padding-left: 80px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure4\">. &amp;&amp; (ET LOGIQUE)<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure41\">. || ( OU LOGIQUE)<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure42\">. ! (NON LOGIQUE)<\/a><strong><br><\/strong><\/p>\n<p style=\"padding-left: 40px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure5\"><strong><span style=\"color: #000000;\">1.5. Les op\u00e9rateurs compos\u00e9s<\/span><\/strong><\/a><\/p>\n<p style=\"padding-left: 80px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure5\">. ++ (incr\u00e9ment) \/ &#8212; (d\u00e9cr\u00e9ment)<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure51\">. += , -= , *= , \/=<\/a><strong><br><\/strong><\/p>\n<p style=\"padding-left: 40px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure6\"><strong><span style=\"color: #000000;\">1.6. Structures de contr\u00f4le<\/span><\/strong><\/a><\/p>\n<p style=\"padding-left: 80px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure6\">. if (condition)<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure61\">. if \/ else<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure62\">. Boucle for<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure63\">. Boucle while<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1563#structure64\">. boucle do \u2013 while<\/a><\/p>\n<p>&nbsp;<\/p>\n\n\n\n<h4><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1610\"><span style=\"color: #3366ff;\"><strong>2. <u>Variables et constantes<\/u><\/strong><\/span><\/a><br><br><\/h4>\n<p style=\"padding-left: 40px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1610#var1\"><strong><span style=\"color: #000000;\">2.1. Les constantes Arduino pr\u00e9d\u00e9finies<\/span><\/strong><\/a><\/p>\n<p style=\"padding-left: 80px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1610#var1\"><strong>.<\/strong> INPUT ET OUTPUT<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1610#var11\">. HIGH ET LOW<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1610#var12\">. true ET false<\/a><strong><br><\/strong><\/p>\n<p style=\"padding-left: 40px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1610#var2\"><span style=\"color: #000000;\"><strong>2.2. Les variables &#8211; Types de donn\u00e9es<\/strong><\/span><\/a><\/p>\n<p style=\"padding-left: 80px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1610#var2\">. Int<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1610#var21\">. unsigned int<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1610#var22\">. long<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1610#var23\" data-wplink-url-error=\"true\">. unsigned long<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1610#var24\">. float<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1610#var25\">. char<\/a><\/p>\n<p>&nbsp;<\/p>\n\n\n\n<h4><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633\"><span style=\"color: #3366ff;\"><strong>3. <span style=\"text-decoration: underline;\">Les fonctions<\/span><\/strong><\/span><\/a><br><br><\/h4>\n<p style=\"padding-left: 40px;\"><strong><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction1\"><span style=\"color: #000000;\">3.1. Fonctions des Entr\u00e9es\/Sorties num\u00e9riques<\/span><\/a><\/strong><\/p>\n<p style=\"padding-left: 80px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction1\">. pinMode()<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction11\">. digitalWrite()<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction12\">. digitalRead()<\/a><strong><br><\/strong><\/p>\n<p style=\"padding-left: 40px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction2\"><span style=\"color: #000000;\"><strong>3.2. Fonctions des Entr\u00e9es\/Sorties analogiques&nbsp;<\/strong><\/span><\/a><\/p>\n<p style=\"padding-left: 80px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction2\">. analogRead()<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction21\">. analogWrite()<\/a><strong><br><\/strong><\/p>\n<p style=\"padding-left: 40px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction3\"><span style=\"color: #000000;\"><strong>3.3. Fonctions des Entr\u00e9es\/Sorties avanc\u00e9es&nbsp;<\/strong><\/span><\/a><\/p>\n<p style=\"padding-left: 80px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction3\">. tone()<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction31\">. noTone()<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction32\">. pulseIn()<\/a><strong><br><\/strong><\/p>\n<p style=\"padding-left: 40px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction4\"><span style=\"color: #000000;\"><strong>3.4. Fonctions de gestion du temps&nbsp;<\/strong><\/span><\/a><\/p>\n<p style=\"padding-left: 80px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction4\">. delay(ms)<\/a><br><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction41\">. unsigned long millis()<\/a><strong><br><\/strong><\/p>\n<p style=\"padding-left: 40px;\"><span style=\"color: #000000;\"><a style=\"color: #000000;\" href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction5\"><strong>3.5. Fonctions de communication (librairie Serial)<\/strong><\/a><br><\/span><\/p>\n<p style=\"padding-left: 40px;\"><a href=\"https:\/\/www.ardpylab.fr\/?page_id=1633#ancrefonction6\"><strong><span style=\"color: #000000;\">3.6. Fonctions propres au programme<\/span><\/strong><\/a><\/p>\n\n\n\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0<\/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=165\"><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=1563\"><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>&nbsp; (Cliquez pour afficher la version PDF) &nbsp; Les programmes en langage Arduino, bas\u00e9 sur les langages C\/C++, peuvent \u00eatre divis\u00e9s en trois parties principales : la structure, les valeurs (variables et constantes) et les fonctions. &nbsp; 1. Structure du programme 1.1. Syntaxe de base . Le point-virgule ;. Les accolades {}. \/\/ Les commentaires [&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-1533","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/pages\/1533","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=1533"}],"version-history":[{"count":0,"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=\/wp\/v2\/pages\/1533\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ardpylab.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1533"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}