
{"id":3430,"date":"2018-04-26T17:06:23","date_gmt":"2018-04-26T17:06:23","guid":{"rendered":"http:\/\/dyor.roboticafacil.es\/?p=3430"},"modified":"2018-04-26T17:06:23","modified_gmt":"2018-04-26T17:06:23","slug":"lectura-de-una-entrada-digital-pulsador-en-facilino","status":"publish","type":"post","link":"https:\/\/dyor.webs.upv.es\/en\/lectura-de-una-entrada-digital-pulsador-en-facilino\/","title":{"rendered":"Digital Input Read (Switch) with Facilino"},"content":{"rendered":"<p>In this post, we show how to read a digital input in Facilino. We show three examples using different instructions, but all of them produce the same result.<\/p>\n<p><!--more--><\/p>\n<p>The aim of this post is to show how to read a digital input in Facilino. Facilino has generic purpose instructions to read digital inputs, but also specific ones to read values from a switch. Both of them produce the same results, so the specific ones can be used one reading from a switch. In addition to this, there&#8217;s also another switch-specific instruction that can distinguish between cases (pressed or released).<\/p>\n<p>We want to show on Facilino&#8217;s console (or Arduino IDE) the state of the switch.<\/p>\n<h3>Circuit<\/h3>\n<p>Here we show the required circuit to complete the example. The switch has been connected to the digital input D2 of Arduino Nano.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-3431\" src=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/switch_example_bb-1024x479.png\" alt=\"\" width=\"600\" height=\"281\" srcset=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/switch_example_bb-1024x479.png 1024w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/switch_example_bb-300x140.png 300w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/switch_example_bb-768x359.png 768w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/switch_example_bb.png 1308w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h3>Facilino<\/h3>\n<p>The following three examples produce the same result, they are simply three different ways for solving the problem.<\/p>\n<h4>Example 1<\/h4>\n<p><iframe loading=\"lazy\" src=\"https:\/\/roboticafacil.es\/facilino\/blockly\/example.html?lang=en-GB&amp;proc=ArduinoNano&amp;example=button_example1.bly\" width=\"800\" height=\"300\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><\/p>\n<h4>Example 2<\/h4>\n<p><iframe loading=\"lazy\" src=\"https:\/\/roboticafacil.es\/facilino\/blockly\/example.html?lang=en-GB&amp;proc=ArduinoNano&amp;example=button_example.bly\" width=\"800\" height=\"300\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><\/p>\n<h4>Example 3<\/h4>\n<p><iframe loading=\"lazy\" src=\"https:\/\/roboticafacil.es\/facilino\/blockly\/example.html?lang=en-GB&amp;proc=ArduinoNano&amp;example=button_case_example.bly\" width=\"800\" height=\"300\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><span style=\"display: inline-block; width: 0px; overflow: hidden; line-height: 0;\" data-mce-type=\"bookmark\" class=\"mce_SELRES_start\">\ufeff<\/span><\/iframe><\/p>","protected":false},"excerpt":{"rendered":"<p>Sorry, this entry is only available in Espa\u00f1ol.<\/p>\n","protected":false},"author":1,"featured_media":3433,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[99],"tags":[],"class_list":["post-3430","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-facilino-ejemplo"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/switch_example_green.png","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":660,"url":"https:\/\/dyor.webs.upv.es\/en\/arduino-intro\/","url_meta":{"origin":3430,"position":0},"title":"Introduction to Arduino","author":"soporte","date":"Tuesday February 14th, 2017","format":false,"excerpt":"Learn how to use Arduino, selection criteria, handling of basic inpunt and output, connection diagrams and some basic programming examples with Facilino. What is Arduino? It's a open hardware platform with breadboard including ATMEL microcontrollers and a programming environment (Arduino IDE). It has been very successful because all the sketches\u2026","rel":"","context":"In &quot;Arduino&quot;","block_context":{"text":"Arduino","link":"https:\/\/dyor.webs.upv.es\/en\/category\/electronica\/arduino\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/facilino_examples_ldr.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/facilino_examples_ldr.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/facilino_examples_ldr.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":3471,"url":"https:\/\/dyor.webs.upv.es\/en\/detectando-colores-sensor-tcs3200\/","url_meta":{"origin":3430,"position":1},"title":"Detecting Colours with TCS3200 sensor","author":"soporte","date":"Friday April 27th, 2018","format":false,"excerpt":"In this post we show how to detect and classify colours using TCS3200 colour sensor and Facilino. Facilino uses simple instructions to detect colours with the TCS3200 sensor. Internally, the instruction uses a SVM that has been trained to classify colours. These instructions require Facilino's license. The aim is to\u2026","rel":"","context":"In &quot;Facilino Ejemplo&quot;","block_context":{"text":"Facilino Ejemplo","link":"https:\/\/dyor.webs.upv.es\/en\/category\/programacion\/facilino\/facilino-ejemplo\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/tcs3200_example_green_key.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":3895,"url":"https:\/\/dyor.webs.upv.es\/en\/instrucciones-matriz-leds-facilino\/","url_meta":{"origin":3430,"position":2},"title":"Instructions for 8&#215;8 LEDs matrix in Facilino","author":"soporte","date":"Monday May 28th, 2018","format":false,"excerpt":"In this post, we explain the set of instructions available in Facilino to draw anything you want in 8x8 LEDs matrix. Available Instructions Facilino has a set of instructions to draw different patterns in an 8x8 LEDs matrix. All drawing instructions require the numbers of the CS, DIN and CLK\u2026","rel":"","context":"In &quot;Facilino Tutorial&quot;","block_context":{"text":"Facilino Tutorial","link":"https:\/\/dyor.webs.upv.es\/en\/category\/programacion\/facilino\/facilino-tutorial\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/05\/led_matrix_orientation_bb.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/05\/led_matrix_orientation_bb.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/05\/led_matrix_orientation_bb.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/05\/led_matrix_orientation_bb.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":2054,"url":"https:\/\/dyor.webs.upv.es\/en\/guia-de-instalacion-de-facilino-en-windows\/","url_meta":{"origin":3430,"position":3},"title":"Gu\u00eda de Instalaci\u00f3n de Facilino en Windows","author":"soporte","date":"Friday June 16th, 2017","format":false,"excerpt":"En esta entrada se describir\u00e1 todo el proceso de descarga, instalaci\u00f3n y activaci\u00f3n de la licencia de Facilino en Windows. Facilino es un programa gratuito, si bien, incluye una licencia para activar las funcionalidades avanzadas. En esta entrada describiremos primero todo el proceso de descarga e instalaci\u00f3n de Facilino. Descarga\u2026","rel":"","context":"In &quot;Facilino Manual&quot;","block_context":{"text":"Facilino Manual","link":"https:\/\/dyor.webs.upv.es\/en\/category\/programacion\/facilino\/facilino-manual\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/06\/Windows.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":2355,"url":"https:\/\/dyor.webs.upv.es\/en\/facilino-web\/","url_meta":{"origin":3430,"position":4},"title":"Facilino Web","author":"soporte","date":"Friday December 15th, 2017","format":false,"excerpt":"Introduction to Facilino Web multiplatform tool. Learn how to use basic features of Facilino (web) and how to program Arduino and ESP processors. Facilino web is a web page that allows you to generate code for Arduino, while the microcontroller programming must be actually carried out with Arduino IDE (Windows,\u2026","rel":"","context":"In &quot;Facilino Manual&quot;","block_context":{"text":"Facilino Manual","link":"https:\/\/dyor.webs.upv.es\/en\/category\/programacion\/facilino\/facilino-manual\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/Facilino_logo_vectorial.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/Facilino_logo_vectorial.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/Facilino_logo_vectorial.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/02\/Facilino_logo_vectorial.jpg?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":3459,"url":"https:\/\/dyor.webs.upv.es\/en\/expresiones-basicas-matriz-leds\/","url_meta":{"origin":3430,"position":5},"title":"Showing Basic Expressions with LEDs Matrix","author":"soporte","date":"Friday April 27th, 2018","format":false,"excerpt":"In this post we show how to generate simple expressions with a 8x8 LEDs matrix max7219 to use with your DYOR robot and Facilino. Facilino has a simple instruction to create expressions with a 8x8 LEDs matrix max7219. This instruction requires Facilino's license. The aim is to show all predefined\u2026","rel":"","context":"In &quot;Facilino Ejemplo&quot;","block_context":{"text":"Facilino Ejemplo","link":"https:\/\/dyor.webs.upv.es\/en\/category\/programacion\/facilino\/facilino-ejemplo\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/led_matrix_example_green_key.png?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts\/3430","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/comments?post=3430"}],"version-history":[{"count":2,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts\/3430\/revisions"}],"predecessor-version":[{"id":3434,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts\/3430\/revisions\/3434"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/media\/3433"}],"wp:attachment":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/media?parent=3430"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/categories?post=3430"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/tags?post=3430"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}