
{"id":3403,"date":"2018-04-26T11:52:17","date_gmt":"2018-04-26T11:52:17","guid":{"rendered":"http:\/\/dyor.roboticafacil.es\/?p=3403"},"modified":"2018-04-27T11:43:53","modified_gmt":"2018-04-27T11:43:53","slug":"cruce-semaforos-facilino","status":"publish","type":"post","link":"https:\/\/dyor.webs.upv.es\/en\/cruce-semaforos-facilino\/","title":{"rendered":"Traffic Light Crossing with Facilino"},"content":{"rendered":"<p>In this post, we will show a simple traffic light crossing example with Facilino using colour LEDs.<\/p>\n<p><!--more--><\/p>\n<p>The aim is to control a traffic light crossing. So, we assume that we have a traffic light with three possible colours as shown in the figure, where green means that you can drive, yellow means that you should slow down and red means to stop.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3404\" src=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/traffic_lights.jpg\" alt=\"\" width=\"547\" height=\"350\" srcset=\"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/traffic_lights.jpg 547w, https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/traffic_lights-300x192.jpg 300w\" sizes=\"auto, (max-width: 547px) 100vw, 547px\" \/><\/p>\n<p>We have 6 colour LEDs, each traffic light has one of each colours. So, traffic lights TL1 and TL2, are placed in a crossing and the following behaviour must be satisfied:<\/p>\n<ul>\n<li>TL1 in read and TL2 in green for 7s.<\/li>\n<li>TL2 in yellow and TL1 is still in red for 3s.<\/li>\n<li>TL1 in green and TL2 in red for 7s.<\/li>\n<li>TL1 in yellow and TL2 is still in red for 3s.<\/li>\n<\/ul>\n<p>This cycle is repeated forever. The expected behaviour, the red light will be ON for 10s, the yellow light 3s ON and the green light will be ON for 7s.<\/p>\n<h3>Circuit<\/h3>\n<p>Here we show the proposed circuit diagram. The red, yellow and green LEDs of TL1 are connected to D2, D3 and D4, respectively. The red, yellow and green LEDs of TL2 are connected to pins D5, D&amp; and D7, respectively.<\/p>\n<h3>Facilino<\/h3>\n<p>Here you can find the solution of the example:<\/p>\n<p style=\"text-align: center;\"><iframe loading=\"lazy\" src=\"https:\/\/roboticafacil.es\/facilino\/blockly\/example.html?lang=en-GB&amp;proc=ArduinoNano&amp;example=traffic_light.bly\" width=\"800\" height=\"950\" 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><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<p style=\"text-align: center;\">\n<p><\/p>","protected":false},"excerpt":{"rendered":"<p>Sorry, this entry is only available in Espa\u00f1ol.<\/p>\n","protected":false},"author":1,"featured_media":3407,"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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[99],"tags":[15,101,37,100],"class_list":["post-3403","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-facilino-ejemplo","tag-arduino","tag-ejemplo","tag-facilino","tag-semaforo"],"aioseo_notices":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/dyor.webs.upv.es\/wp-content\/uploads\/2018\/04\/traffic_light_green.png","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":3471,"url":"https:\/\/dyor.webs.upv.es\/en\/detectando-colores-sensor-tcs3200\/","url_meta":{"origin":3403,"position":0},"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":3466,"url":"https:\/\/dyor.webs.upv.es\/en\/mostrando-texto-matriz-leds\/","url_meta":{"origin":3403,"position":1},"title":"Showing Text with the LEDs Matrix","author":"soporte","date":"Friday April 27th, 2018","format":false,"excerpt":"In this post we show how to show text with a 8x8 LEDs matrix max7219 to use with your DYOR robot and Facilino. Facilino has a simple instruction to show some text with a 8x8 LEDs matrix max7219. This instruction requires Facilino's license. The aim is to show the sentence\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":[]},{"id":3459,"url":"https:\/\/dyor.webs.upv.es\/en\/expresiones-basicas-matriz-leds\/","url_meta":{"origin":3403,"position":2},"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":[]},{"id":3895,"url":"https:\/\/dyor.webs.upv.es\/en\/instrucciones-matriz-leds-facilino\/","url_meta":{"origin":3403,"position":3},"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":3011,"url":"https:\/\/dyor.webs.upv.es\/en\/facilino-matriz-de-leds-y-pantalla-lcd\/","url_meta":{"origin":3403,"position":4},"title":"LED Matrix and LCD Screens in Facilino","author":"soporte","date":"Friday April  6th, 2018","format":false,"excerpt":"In this presentation we show some block programming instructions of Facilino to use a LED Matrix and LCD Screens. Presentation Video","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":"","width":0,"height":0},"classes":[]},{"id":2395,"url":"https:\/\/dyor.webs.upv.es\/en\/presentamos-nuevos-modelos-en-el-ce-marni\/","url_meta":{"origin":3403,"position":5},"title":"Presentamos nuevos modelos en el CE Marni","author":"soporte","date":"Saturday December 16th, 2017","format":false,"excerpt":"Sorry, this entry is only available in Espa\u00f1ol.","rel":"","context":"In &quot;Noticias&quot;","block_context":{"text":"Noticias","link":"https:\/\/dyor.webs.upv.es\/en\/category\/noticias\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/12\/IMG-20171214-WA0012.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/12\/IMG-20171214-WA0012.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/12\/IMG-20171214-WA0012.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/12\/IMG-20171214-WA0012.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/12\/IMG-20171214-WA0012.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/dyor.webs.upv.es\/wp-content\/uploads\/2017\/12\/IMG-20171214-WA0012.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts\/3403","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=3403"}],"version-history":[{"count":4,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts\/3403\/revisions"}],"predecessor-version":[{"id":3457,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/posts\/3403\/revisions\/3457"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/media\/3407"}],"wp:attachment":[{"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/media?parent=3403"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/categories?post=3403"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dyor.webs.upv.es\/en\/wp-json\/wp\/v2\/tags?post=3403"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}