{"id":142,"date":"2021-07-11T17:09:42","date_gmt":"2021-07-11T17:09:42","guid":{"rendered":"http:\/\/imported-86"},"modified":"2021-07-11T17:09:42","modified_gmt":"2021-07-11T17:09:42","slug":"comandare-un-led-con-un-pulsante-esterno","status":"publish","type":"post","link":"http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/","title":{"rendered":"Comandare un LED con un pulsante esterno"},"content":{"rendered":"<p><span style=\"font-family: times new roman, times; font-size: 12pt;\">&nbsp;&nbsp; In questo esempio accenderemo e spegneremo un LED mediante un pulsante esterno al circuito del LED, che per questioni di praticit\u00e0 potr\u00e0 essere inserito direttamente sulle porte GND e 13 di Arduino.<\/span><\/p>\n<p><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp; Per prendere confidenza con diversi modi di risolvere lo stesso problema, vengono presentate pi\u00f9 soluzioni leggermente diverse fra loro.<\/span><\/p>\n<p><img decoding=\"async\" src=\"\/images\/Arduino\/comandare-un-led-con-un-pulsante-esterno\/Comandare_un_LED_con_un_pulsante_esterno_html_154b7c2f5820a7f7.png\" alt=\"Comandare un LED con un pulsante esterno html 154b7c2f5820a7f7\" style=\"margin: 50px; float: left;\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-family: courier new, courier; font-size: 14pt;\">Componenti<\/span><\/strong><\/p>\n<ul>\n<li><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;1 LED<\/span><\/li>\n<li><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;1 pulsante 1<\/span><\/li>\n<li><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;3 cavetti MM<\/span><\/li>\n<li><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;1 resistenza da 10 k\u03a9<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<hr class=\"system-pagebreak\" title=\"Esempio presente nell\u2019IDE\" \/>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 14pt;\"><strong><span style=\"font-family: courier new, courier;\">Esempio presente nell\u2019IDE in 02.Digital\/Botton<\/span><\/strong><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"\/images\/Arduino\/comandare-un-led-con-un-pulsante-esterno\/Comandare_un_LED_con_un_pulsante_esterno_html_55a9cef09ca70f08.png\" alt=\"Comandare un LED con un pulsante esterno html 55a9cef09ca70f08\" width=\"400\" height=\"257\" \/>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">const int buttonPin = 2;<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">const int ledPin = 13;<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">int buttonState = 0;<\/span><\/code><\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">void setup() {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; pinMode(ledPin, OUTPUT);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; pinMode(buttonPin, INPUT);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">}<\/span><\/code><\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">void loop() {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">  buttonState = digitalRead(buttonPin);<\/span><\/code><\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">  if (buttonState == HIGH) {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">    digitalWrite(ledPin, HIGH);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">  } <\/span><\/code><\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">  else {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">    digitalWrite(ledPin, LOW);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">  }<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">}<\/span><\/code><br \/><span style=\"font-family: courier new, courier; font-size: 12pt;\"><\/span><\/p>\n<p><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp; A riposo, i due lati dell\u2019interruttore non sono collegati tra loro, e si dice che il pulsante \u00e8 normalmente aperto. In tale esempio il LED rimane acceso finch\u00e9 \u00e8 premuto il pulsante, poi si spegne; negli esempi che seguono il pulsante si comporta da commutatore.<\/span><\/p>\n<hr class=\"system-pagebreak\" title=\"Prima proposta\" \/>\n<p><strong><span style=\"font-family: courier new, courier; font-size: 14pt;\">Prima proposta (con due variabili char)<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp; Memorizzeremo lo stato del LED e del pulsante, rispettivamente nelle variabile statoLED e statoPulsante ambedue di tipo char inizializzate con il valore \u201cfalse\u201d ossia 0.<\/span><\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">int led = 13;<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">int pulsante = 2;<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">char statoLED = 0;<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">char statoPulsante = 0;<\/span><\/code><\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">void setup() {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; pinMode(led, OUTPUT);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; pinMode(pulsante, INPUT);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">}<\/span><\/code><\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">void loop() {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; statoPulsante = digitalRead(pulsante);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; if (statoPulsante == HIGH) {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp;&nbsp; if (statoLED == 0) {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; digitalWrite(led, 1);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; statoLED = 1;<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp;&nbsp; }<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp;&nbsp; else {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; digitalWrite(led, 0);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; statoLED = 0;<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp;&nbsp; }<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; }<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">delay(250);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">}<\/span><\/code><\/p>\n<hr class=\"system-pagebreak\" title=\"Seconda proposta e terza proposta\" \/>\n<p><strong><span style=\"font-family: courier new, courier; font-size: 14pt;\">Seconda proposta (con una sola variabile char)<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">int led=13;<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">int pulsante=2;<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">char statoLED=false;<\/span><\/code><\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">void setup() {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; pinMode(led,OUTPUT);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; pinMode(pulsante,INPUT);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">}<\/span><\/code><\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">void loop(){<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; if(digitalRead(pulsante)==HIGH){<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp;&nbsp; statoLED=!statoLED;<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp;&nbsp; digitalWrite(led,statoLED);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; }<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">delay(250);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">}<\/span><\/code><\/p>\n<p>&nbsp;<\/p>\n<p><strong><span style=\"font-family: courier new, courier; font-size: 14pt;\">Terza proposta<\/span><\/strong><\/p>\n<p>&nbsp;<\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">int led = 13;<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">int pulsante = 2;<\/span><\/code><\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">void setup() {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">  pinMode(led, OUTPUT);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">  pinMode(pulsante, INPUT);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">}<\/span><\/code><\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">void loop() {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">  if (digitalRead(pulsante)) {<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">    digitalWrite(led, !digitalRead(pulsante));<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">  }<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">  delay(250);<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">}<\/span><\/code><\/p>\n<hr class=\"system-pagebreak\" title=\"Nota\" \/>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 14pt;\"><strong><span style=\"font-family: courier new, courier;\">Nota<\/span><\/strong><\/span><\/p>\n<p><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp;&nbsp; Per come sono costruiti i pulsanti presentano il cosiddetto effetto rimbalzo, ovvero non appena premuti, nei primi millisecondi, generano rumore che potrebbe dare false letture.<\/span><\/p>\n<p><span style=\"font-family: courier new, courier; font-size: 12pt;\">Per alcuni il modo per superare questo problema pu\u00f2 essere quello di ripetere la lettura dell\u2019input a distanza di qualche millisecondo e verificare se sono uguali<\/span><\/p>\n<p><code>...<\/code><\/p>\n<p><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">void loop(){<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; val1 = digitalRead(pinPulsante); \/\/ legge il valore<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; delay(10); \/\/ aspetta 10 millisecondi<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; val2 = digitalRead(pinPulsante); \/\/ rilegge il valore<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; if (val1 == val2) { \/\/ se i due valori sono uguali...<\/span><\/code><br \/><code><span style=\"font-family: courier new, courier; font-size: 12pt;\">etc. etc.<\/span><\/code><\/p>\n<p><span style=\"font-family: courier new, courier; font-size: 12pt;\">&nbsp; Per altri basterebbe introdurre una pausa opportuna, ad esempio 100-300 ms, fra una lettura dello stato dell\u2019interruttore e la successiva.<\/span><\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<p class=\"sdfootnote\">&nbsp;<a href=\"http:\/\/mbortolotti.blogspot.com\/2012\/01\/led-e-pulsante-digital-inputcontinua.html?m=1\">http:\/\/mbortolotti.blogspot.com\/2012\/01\/led-e-pulsante-digital-inputcontinua.html?m=1<\/a><\/p>\n<p>&nbsp;<a href=\"https:\/\/www.arduino.cc\/reference\/en\/language\/functions\/math\/constrain\/\">https:\/\/www.arduino.cc\/reference\/en\/language\/functions\/math\/constrain\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;&nbsp; In questo esempio accenderemo e spegneremo un LED mediante un pulsante esterno al circuito del LED, che per questioni di praticit\u00e0 potr\u00e0 essere inserito direttamente sulle porte GND e [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_EventAllDay":false,"_EventTimezone":"","_EventStartDate":"","_EventEndDate":"","_EventStartDateUTC":"","_EventEndDateUTC":"","_EventShowMap":false,"_EventShowMapLink":false,"_EventURL":"","_EventCost":"","_EventCostDescription":"","_EventCurrencySymbol":"","_EventCurrencyCode":"","_EventCurrencyPosition":"","_EventDateTimeSeparator":"","_EventTimeRangeSeparator":"","_EventOrganizerID":[],"_EventVenueID":[],"_OrganizerEmail":"","_OrganizerPhone":"","_OrganizerWebsite":"","_VenueAddress":"","_VenueCity":"","_VenueCountry":"","_VenueProvince":"","_VenueState":"","_VenueZip":"","_VenuePhone":"","_VenueURL":"","_VenueStateProvince":"","_VenueLat":"","_VenueLng":"","_VenueShowMap":false,"_VenueShowMapLink":false,"footnotes":""},"categories":[13],"tags":[],"class_list":["post-142","post","type-post","status-publish","format-standard","hentry","category-giochi-di-luce-con-arduino"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Comandare un LED con un pulsante esterno - PugliaSOS2.0<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/\" \/>\n<meta property=\"og:locale\" content=\"it_IT\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Comandare un LED con un pulsante esterno - PugliaSOS2.0\" \/>\n<meta property=\"og:description\" content=\"&nbsp;&nbsp; In questo esempio accenderemo e spegneremo un LED mediante un pulsante esterno al circuito del LED, che per questioni di praticit\u00e0 potr\u00e0 essere inserito direttamente sulle porte GND e [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/\" \/>\n<meta property=\"og:site_name\" content=\"PugliaSOS2.0\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-11T17:09:42+00:00\" \/>\n<meta name=\"author\" content=\"PugliaSOS\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Scritto da\" \/>\n\t<meta name=\"twitter:data1\" content=\"PugliaSOS\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tempo di lettura stimato\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minuti\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/130.110.14.181\\\/index.php\\\/2021\\\/07\\\/11\\\/comandare-un-led-con-un-pulsante-esterno\\\/#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/130.110.14.181\\\/index.php\\\/2021\\\/07\\\/11\\\/comandare-un-led-con-un-pulsante-esterno\\\/\"},\"author\":{\"name\":\"PugliaSOS\",\"@id\":\"http:\\\/\\\/130.110.14.181\\\/#\\\/schema\\\/person\\\/1e219b3d8de394c7d6969b52c116f336\"},\"headline\":\"Comandare un LED con un pulsante esterno\",\"datePublished\":\"2021-07-11T17:09:42+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/130.110.14.181\\\/index.php\\\/2021\\\/07\\\/11\\\/comandare-un-led-con-un-pulsante-esterno\\\/\"},\"wordCount\":290,\"articleSection\":[\"Giochi di luce con Arduino\"],\"inLanguage\":\"it-IT\"},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/130.110.14.181\\\/index.php\\\/2021\\\/07\\\/11\\\/comandare-un-led-con-un-pulsante-esterno\\\/\",\"url\":\"http:\\\/\\\/130.110.14.181\\\/index.php\\\/2021\\\/07\\\/11\\\/comandare-un-led-con-un-pulsante-esterno\\\/\",\"name\":\"Comandare un LED con un pulsante esterno - PugliaSOS2.0\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/130.110.14.181\\\/#website\"},\"datePublished\":\"2021-07-11T17:09:42+00:00\",\"author\":{\"@id\":\"http:\\\/\\\/130.110.14.181\\\/#\\\/schema\\\/person\\\/1e219b3d8de394c7d6969b52c116f336\"},\"breadcrumb\":{\"@id\":\"http:\\\/\\\/130.110.14.181\\\/index.php\\\/2021\\\/07\\\/11\\\/comandare-un-led-con-un-pulsante-esterno\\\/#breadcrumb\"},\"inLanguage\":\"it-IT\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/130.110.14.181\\\/index.php\\\/2021\\\/07\\\/11\\\/comandare-un-led-con-un-pulsante-esterno\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/130.110.14.181\\\/index.php\\\/2021\\\/07\\\/11\\\/comandare-un-led-con-un-pulsante-esterno\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/130.110.14.181\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Comandare un LED con un pulsante esterno\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/130.110.14.181\\\/#website\",\"url\":\"http:\\\/\\\/130.110.14.181\\\/\",\"name\":\"PugliaSOS2.0\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\\\/\\\/130.110.14.181\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"it-IT\"},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/130.110.14.181\\\/#\\\/schema\\\/person\\\/1e219b3d8de394c7d6969b52c116f336\",\"name\":\"PugliaSOS\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"it-IT\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0f3d85b8e8409fc2c484f438be7de4caf93659f326adbb248e8a1ac5c2e16fd6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0f3d85b8e8409fc2c484f438be7de4caf93659f326adbb248e8a1ac5c2e16fd6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0f3d85b8e8409fc2c484f438be7de4caf93659f326adbb248e8a1ac5c2e16fd6?s=96&d=mm&r=g\",\"caption\":\"PugliaSOS\"},\"url\":\"http:\\\/\\\/130.110.14.181\\\/index.php\\\/author\\\/pugliasos\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Comandare un LED con un pulsante esterno - PugliaSOS2.0","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/","og_locale":"it_IT","og_type":"article","og_title":"Comandare un LED con un pulsante esterno - PugliaSOS2.0","og_description":"&nbsp;&nbsp; In questo esempio accenderemo e spegneremo un LED mediante un pulsante esterno al circuito del LED, che per questioni di praticit\u00e0 potr\u00e0 essere inserito direttamente sulle porte GND e [&hellip;]","og_url":"http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/","og_site_name":"PugliaSOS2.0","article_published_time":"2021-07-11T17:09:42+00:00","author":"PugliaSOS","twitter_card":"summary_large_image","twitter_misc":{"Scritto da":"PugliaSOS","Tempo di lettura stimato":"2 minuti"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/#article","isPartOf":{"@id":"http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/"},"author":{"name":"PugliaSOS","@id":"http:\/\/130.110.14.181\/#\/schema\/person\/1e219b3d8de394c7d6969b52c116f336"},"headline":"Comandare un LED con un pulsante esterno","datePublished":"2021-07-11T17:09:42+00:00","mainEntityOfPage":{"@id":"http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/"},"wordCount":290,"articleSection":["Giochi di luce con Arduino"],"inLanguage":"it-IT"},{"@type":"WebPage","@id":"http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/","url":"http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/","name":"Comandare un LED con un pulsante esterno - PugliaSOS2.0","isPartOf":{"@id":"http:\/\/130.110.14.181\/#website"},"datePublished":"2021-07-11T17:09:42+00:00","author":{"@id":"http:\/\/130.110.14.181\/#\/schema\/person\/1e219b3d8de394c7d6969b52c116f336"},"breadcrumb":{"@id":"http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/#breadcrumb"},"inLanguage":"it-IT","potentialAction":[{"@type":"ReadAction","target":["http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/130.110.14.181\/index.php\/2021\/07\/11\/comandare-un-led-con-un-pulsante-esterno\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/130.110.14.181\/"},{"@type":"ListItem","position":2,"name":"Comandare un LED con un pulsante esterno"}]},{"@type":"WebSite","@id":"http:\/\/130.110.14.181\/#website","url":"http:\/\/130.110.14.181\/","name":"PugliaSOS2.0","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/130.110.14.181\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"it-IT"},{"@type":"Person","@id":"http:\/\/130.110.14.181\/#\/schema\/person\/1e219b3d8de394c7d6969b52c116f336","name":"PugliaSOS","image":{"@type":"ImageObject","inLanguage":"it-IT","@id":"https:\/\/secure.gravatar.com\/avatar\/0f3d85b8e8409fc2c484f438be7de4caf93659f326adbb248e8a1ac5c2e16fd6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0f3d85b8e8409fc2c484f438be7de4caf93659f326adbb248e8a1ac5c2e16fd6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0f3d85b8e8409fc2c484f438be7de4caf93659f326adbb248e8a1ac5c2e16fd6?s=96&d=mm&r=g","caption":"PugliaSOS"},"url":"http:\/\/130.110.14.181\/index.php\/author\/pugliasos\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/130.110.14.181\/index.php\/wp-json\/wp\/v2\/posts\/142","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/130.110.14.181\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/130.110.14.181\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/130.110.14.181\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/130.110.14.181\/index.php\/wp-json\/wp\/v2\/comments?post=142"}],"version-history":[{"count":0,"href":"http:\/\/130.110.14.181\/index.php\/wp-json\/wp\/v2\/posts\/142\/revisions"}],"wp:attachment":[{"href":"http:\/\/130.110.14.181\/index.php\/wp-json\/wp\/v2\/media?parent=142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/130.110.14.181\/index.php\/wp-json\/wp\/v2\/categories?post=142"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/130.110.14.181\/index.php\/wp-json\/wp\/v2\/tags?post=142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}