{"id":1818,"date":"2023-11-20T10:38:44","date_gmt":"2023-11-20T10:38:44","guid":{"rendered":"https:\/\/arcachofo.com\/p\/328_guess_led_game\/"},"modified":"2024-02-12T04:01:50","modified_gmt":"2024-02-12T04:01:50","slug":"328_guess_led_game","status":"publish","type":"post","link":"https:\/\/simulide.com\/p\/328_guess_led_game\/","title":{"rendered":"GUESS LED GAME__(DF328)"},"content":{"rendered":"<h3><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"><strong>PURPOSE.<\/strong> <\/span><\/span><\/span><\/h3>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">Game consisting of guessing the color of the LED that will light up after pressing the button.<\/span><\/span><\/span><\/p>\n<h3><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"><strong>USE.<\/strong> <\/span><\/span><\/span><\/h3>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">When starting the program the <strong>&#8220;THINK COLOR&#8221;<\/strong> LED flashes, think of one of the four colors.<\/span><\/span> <span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">Then press the button, the randomly generated LED number lights up for a few seconds and a small warning beep sounds.<\/span><\/span> <span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">The player will determine if he was correct or not.<\/span><\/span> <\/span><\/p>\n<h3><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"><strong>DIAGRAM.<\/strong> <\/span><\/span><\/span><\/h3>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">The controller is the ATTiny84.<\/span><\/span> <span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">There are 4 LEDs of YELLOW, BLUE, RED AND GREEN colors connected to the Tiny84.<\/span><\/span> <\/span><\/p>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">Another yellow <strong>&#8220;THINK COLOR&#8221;<\/strong> LED at D11, a speaker at 8, the trigger button at D1.<\/span><\/span><\/span><\/p>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"> A low frequency randomness seed oscillator at A0.<\/span><\/span>\u00a0<\/span><\/p>\n<h3><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"><strong>PROGRAM.<\/strong> <\/span><\/span><\/span><\/h3>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">The source program and the executable are included.<\/span><\/span> <span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">The C program is responsible for managing all the LEDs and the sound.<\/span><\/span> <\/span><\/p>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">When starting the program, the <strong>&#8220;THINK COLOR&#8221;<\/strong> LED flashes regularly in millis mode (instead of delay) so that the program sequence does not interfere with its flashing.<\/span><\/span> <span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">In this indeterminate time the player has to think of one of the four colors.<\/span><\/span> <\/span><\/p>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">When you press the button, the number of one of the four colored LEDs is generated, which then illuminates it for a few seconds, turning off the previous LED.<\/span><\/span> <span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">From here the sequence repeats.<\/span><\/span> <\/span><\/p>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">The randomness seed is obtained by A0.<\/span><\/span> <span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">The randomization instruction: led=random(3, 7) to manage the 4 leds and the sound with: tone(beep, 1000, 60) where &#8220;beep&#8221; is the port, 1000 is the tone and 60 is the time in<\/span><\/span> <span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">milliseconds.<\/span><\/span> <\/span><\/p>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">IMPORTANT do not forget to configure Simulide for ATTiny84 if the program is compiled.<\/span><\/span><\/span><\/p>\n<h3><span class=\"HwtZe\" lang=\"en\"><strong><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">MISCELLANY.<\/span><\/span> <\/strong><\/span><\/h3>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">The attached zip file typically includes:<\/span><\/span> <\/span><\/p>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"><strong>1)<\/strong> Electrical diagram.<\/span><\/span> <br \/><\/span><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"><strong>2)<\/strong> Source program.<\/span><\/span> <br \/><\/span><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"><strong>3)<\/strong> Executable.<\/span><\/span> <br \/><\/span><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"><strong>4)<\/strong> <strong>&#8220;data&#8221;<\/strong> folder<\/span><\/span>. <\/span><\/p>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">This data folder contains the subcircuits (custom) created by the author.<\/span><\/span> <span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"><strong>The presence of this folder<\/strong> is necessary for the execution of the project.<\/span><\/span>\u00a0<\/span><\/p>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"><em><strong>SUBCIRCUIT:<\/strong><\/em> It is a <strong>&#8220;custom&#8221;<\/strong> circuit that accumulates a set of Simulide base components to obtain a <strong>new<\/strong> or an <strong>adapted function<\/strong>. These subcircuits are treated by Simulide as another component of its own structure.<br \/><\/span><\/span><\/span><\/p>\n<h6><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"><strong>Subcircuits<\/strong> are very useful to <strong>create a component<\/strong> that does not exist in the simulide set, to <strong>compress a complete schematic<\/strong> in a single block and thus improve the complexity and compression of the final circuit where it is integrated or for <strong>any other function<\/strong> that you want to have available when making a schematic.<\/span><\/span><\/span><\/h6>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">The subcircuits must be properly incorporated in the <strong>&#8220;data&#8221; folder of simulide<\/strong>, in the <strong>&#8220;User Data&#8221; folder<\/strong> or in the <strong>&#8220;data&#8221; scheme folder<\/strong> that must be attached together with the schematic of the project itself.<\/span><\/span> <span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">Attaching the subcircuits to the Simulide &#8220;data&#8221; folder is not advisable because they can be lost with updates to it.<\/span><\/span> <span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">Attaching them in &#8220;User Data&#8221; is the correct thing to do.<\/span><\/span> <span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">Attaching it to the &#8220;data&#8221; folder of the diagram is necessary when it is shared.<\/span><\/span><\/span><\/p>\n<p><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\"><strong>Creating and locating a subcircuit<\/strong> is simple once you know the procedure that is explained in detail in the simulide tutorials:<\/span><\/span><\/span><\/p>\n<div dir=\"ltr\"><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">\u00a0<strong><a href=\"https:\/\/simulide.com\/p\/subcircuits\/\">https:\/\/simulide.com\/p\/subcircuits\/<\/a><\/strong><\/span><\/span><\/span><\/div>\n<div dir=\"ltr\">\u00a0<\/div>\n<div class=\"lRu31\" dir=\"ltr\"><span class=\"HwtZe\" lang=\"en\"><span class=\"jCAhz ChMk0b\"><span class=\"ryNqvb\">* <strong>Communication with the author<\/strong>: Simulide\/User\/Messages\/Defra<\/span><\/span><\/span><\/div>\n<h3><strong>RESOURCES.<\/strong><\/h3>\n<p><a href=\"https:\/\/www.alldatasheet.es\/datasheet-pdf\/pdf\/391512\/ATMEL\/ATTINY84.html\"><em><strong>ATTiny84 from Atmel:<\/strong><\/em><\/a><\/p>\n\n<style>.wp-block-kadence-spacer.kt-block-spacer-1818_64808c-9f .kt-block-spacer{height:60px;}.wp-block-kadence-spacer.kt-block-spacer-1818_64808c-9f .kt-divider{border-top-width:1px;height:1px;border-top-color:#eee;width:80%;border-top-style:solid;}<\/style>\n<div class=\"wp-block-kadence-spacer aligncenter kt-block-spacer-1818_64808c-9f\"><div class=\"kt-block-spacer kt-block-spacer-halign-center\"><hr class=\"kt-divider\"\/><\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Downloads:<\/strong><\/h2>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-8cf8fde6-0100-442f-927d-8fbea1fdd687\" href=\"https:\/\/simulide.com\/p\/wp-content\/uploads\/2023\/11\/328_GUESS_LED_GAME.zip\">328_GUESS_LED_GAME<\/a><a href=\"https:\/\/simulide.com\/p\/wp-content\/uploads\/2023\/11\/328_GUESS_LED_GAME.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-8cf8fde6-0100-442f-927d-8fbea1fdd687\">Download<\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Guess a color game<\/p>\n","protected":false},"author":3,"featured_media":2240,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1818","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino"],"_links":{"self":[{"href":"https:\/\/simulide.com\/p\/wp-json\/wp\/v2\/posts\/1818","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simulide.com\/p\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simulide.com\/p\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simulide.com\/p\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/simulide.com\/p\/wp-json\/wp\/v2\/comments?post=1818"}],"version-history":[{"count":23,"href":"https:\/\/simulide.com\/p\/wp-json\/wp\/v2\/posts\/1818\/revisions"}],"predecessor-version":[{"id":2905,"href":"https:\/\/simulide.com\/p\/wp-json\/wp\/v2\/posts\/1818\/revisions\/2905"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/simulide.com\/p\/wp-json\/wp\/v2\/media\/2240"}],"wp:attachment":[{"href":"https:\/\/simulide.com\/p\/wp-json\/wp\/v2\/media?parent=1818"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simulide.com\/p\/wp-json\/wp\/v2\/categories?post=1818"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simulide.com\/p\/wp-json\/wp\/v2\/tags?post=1818"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}