{"id":6536,"date":"2024-07-02T16:20:03","date_gmt":"2024-07-02T19:20:03","guid":{"rendered":"https:\/\/www.usinainfo.com.br\/blog\/?p=6536"},"modified":"2025-01-10T09:43:43","modified_gmt":"2025-01-10T12:43:43","slug":"jogo-da-cobrinha-diy-com-matriz-de-led","status":"publish","type":"post","link":"https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/","title":{"rendered":"Jogo da cobrinha DIY &#8211; Com matriz de LED"},"content":{"rendered":"<p>Venha aprender a criar um dos jogos cl\u00e1ssicos do in\u00edcio da era dos celulares, agora em formato DIY com seu Arduino, semelhante ao\u00a0 famoso Jogo da Cobrinha!<\/p>\n<p><a href=\"https:\/\/www.usinainfo.com.br\/blog\/wp-content\/uploads\/2024\/07\/Snake-game.png\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-6538 aligncenter\" src=\"https:\/\/www.usinainfo.com.br\/blog\/wp-content\/uploads\/2024\/07\/Snake-game.png\" alt=\"\" width=\"300\" height=\"249\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>Sendo um jogo simples, que pode ser feito com poucos componentes e ainda assim garantir bastante divers\u00e3o at\u00e9 os dias de hoje, um jogo atemporal.<\/p>\n<p>Este pequeno projeto pode ser o pontap\u00e9 inicial para voc\u00ea deslumbrar do muito Maker e finalmente realizar seus pr\u00f3prios projetos, basta ter criatividade, alguns componentes e m\u00e3o na massa!<\/p>\n<h2><\/h2>\n<h2><strong>Material Necess\u00e1rio<\/strong><\/h2>\n<ul>\n<li>1x <a href=\"https:\/\/www.usinainfo.com.br\/compativeis\/arduino-uno-r3-cabo-usb-ab-arduino-3513.html\">Arduino UNO R3 + Cabo USB AB;<\/a><\/li>\n<li>1x <a href=\"https:\/\/www.usinainfo.com.br\/protoboard-e-jumpers\/protoboard-400-pontos-para-montagem-de-projetos-2323.html\">Protoboard;<\/a><\/li>\n<li>1x <a href=\"https:\/\/www.usinainfo.com.br\/modulos-para-arduino\/modulo-matriz-de-led-8x8-vermelho-slim-max7219-4608.html\">Matriz de LED 8&#215;8;<\/a><\/li>\n<li>1x <a href=\"https:\/\/www.usinainfo.com.br\/push-buttons\/kit-push-button-12x12-com-capas-coloridas-25-unidades-7260.html\">Kit Push Button 12&#215;12 Colorido \/ Chave t\u00e1ctil 12\u00d712;<\/a><\/li>\n<li>1x <a href=\"https:\/\/www.usinainfo.com.br\/protoboard-e-jumpers\/jumper-para-protoboard-macho-macho-40-pcs-20cm-2611.html\">Jumper Macho-Macho;<\/a><\/li>\n<li>1x <a href=\"https:\/\/www.usinainfo.com.br\/jumper\/jumper-premium-para-protoboard-macho-femea-20cm-kit-c-20-pecas-2314.html\">Jumper Macho-F\u00eamea;<\/a><\/li>\n<li>1x <a href=\"https:\/\/www.usinainfo.com.br\/jumper\/kit-140-jumpers-rigidos-em-u-para-protoboard-1373.html\">Jumper R\u00edgidos<\/a> (Opcional, para acabamento).<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2><strong>Diagrama de Conex\u00e3o<\/strong><\/h2>\n<div id=\"attachment_6540\" style=\"width: 720px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.usinainfo.com.br\/blog\/wp-content\/uploads\/2024\/07\/Ligacao-Jogo-da-cobrinha.png\" data-rel=\"lightbox-image-1\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-6540\" class=\"wp-image-6540 size-full\" src=\"https:\/\/www.usinainfo.com.br\/blog\/wp-content\/uploads\/2024\/07\/Ligacao-Jogo-da-cobrinha.png\" alt=\"\" width=\"710\" height=\"616\" srcset=\"https:\/\/www.usinainfo.com.br\/blog\/wp-content\/uploads\/2024\/07\/Ligacao-Jogo-da-cobrinha.png 710w, https:\/\/www.usinainfo.com.br\/blog\/wp-content\/uploads\/2024\/07\/Ligacao-Jogo-da-cobrinha-300x260.png 300w\" sizes=\"auto, (max-width: 710px) 100vw, 710px\" \/><\/a><p id=\"caption-attachment-6540\" class=\"wp-caption-text\"><em>Diagrama de conex\u00f5es Jogo da cobrinha DIY com Arduino<\/em><\/p><\/div>\n<h2><strong>Programa\u00e7\u00e3o Jogo da cobrinha DIY:<\/strong><\/h2>\n<pre class=\"lang:c# decode:true \">\/\/ The MAX7219 uses SPI communication protocol...Hence, import SPI.h library\r\n#include &lt;SPI.h&gt;\r\n\r\n\/\/ The chip select pin\r\n#define CS 10\r\n\r\n\/\/ Few necessary registers for configuring the MAX7219 chip\r\n#define DECODE_MODE 9\r\n#define INTENSITY 0x0A\r\n#define SCAN_LIMIT 0x0B\r\n#define SHUTDOWN 0x0C\r\n#define DISPLAY_TEST 0x0F\r\n\r\n\/\/ Buttons used for controlling the snake\r\n#define left_button 2\r\n#define right_button 3\r\n\r\nvolatile byte move_left = 0;\r\nvolatile byte move_right = 0;\r\n\r\n\/\/ Varibles for snake\r\nint snake_l = 2;\r\nconst int max_len = 30;\r\nint snake[max_len][2];\r\nbyte cur_heading = 0;\r\n\r\n\/\/ Variable for food blob\r\nint blob[2] = { 0, 0 };\r\nint is_eaten = 1;\r\n\r\n\/\/ The game scene\r\nbyte scene[8] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };\r\n\r\n\/\/ A general function to send data to the MAX7219\r\nvoid SendData(uint8_t address, uint8_t value) {\r\n  digitalWrite(CS, LOW);\r\n  SPI.transfer(address);   \/\/ Send address.\r\n  SPI.transfer(value);     \/\/   Send the value.\r\n  digitalWrite(CS, HIGH);  \/\/ Finish transfer.\r\n}\r\n\r\n\/\/ Function to initialize the game variables\r\nvoid init_game() {\r\n  is_eaten = 1;\r\n  move_left = 0;\r\n  move_right = 0;\r\n  cur_heading = 0;\r\n  snake_l = 2;\r\n  for (int i = 0; i &lt; max_len; i++)\r\n    for (int j = 0; j &lt; 2; j++)\r\n      snake[i][j] = 0;\r\n  snake[max_len - 1][0] = 2;\r\n  snake[max_len - 1][1] = 5;\r\n  snake[max_len - 2][0] = 1;\r\n  snake[max_len - 2][1] = 5;\r\n  refresh_scene();\r\n  while ((move_left || move_right) == 0)\r\n    ;\r\n  move_left = 0;\r\n  move_right = 0;\r\n}\r\n\r\n\/\/ Function to draw snake on gamescene\r\nvoid spawn_snake() { \r\n  \/\/ If the snake goes out of the scene, it enters from the other side\r\n  for (int j = max_len - snake_l; j &lt; max_len; j++) {\r\n    if (snake[j][0] &lt;= 0)\r\n      snake[j][0] = 8 + snake[j][0];\r\n    else if (snake[j][0] &gt;= 9)\r\n      snake[j][0] = snake[j][0] - 8;\r\n    if (snake[j][1] &lt;= 0)\r\n      snake[j][1] = 8 + snake[j][1];\r\n    else if (snake[j][1] &gt;= 9)\r\n      snake[j][1] = snake[j][1] - 8;\r\n\r\n    \/\/ Draw the snake on the LED matrix\r\n    scene[snake[j][0] - 1] |= (1 &lt;&lt; (snake[j][1] - 1));\r\n  }\r\n}\r\n\r\n\/\/ Function to update the position and length of the snake\r\nvoid snake_move() {\r\n  \/\/ If snake eats a blob...Increase length\r\n  if (snake[max_len - 1][0] == blob[0] &amp;&amp; snake[max_len - 1][1] == blob[1]) {\r\n    is_eaten = 1;\r\n    snake_l += 1;\r\n  }\r\n\r\n  \/\/ Move each pixel forward\r\n  for (int i = snake_l - 1; i &gt;= 1; i--) {\r\n    snake[max_len - 1 - i][0] = snake[max_len - i][0];\r\n    snake[max_len - 1 - i][1] = snake[max_len - i][1];\r\n  }\r\n\r\n  \/\/ Move the head according to button input\r\n  if (move_left == 1) {\r\n    if (cur_heading == 0) {\r\n      cur_heading = 1;\r\n      snake[max_len - 1][1] -= 1;\r\n    } else if (cur_heading == 1) {\r\n      cur_heading = 2;\r\n      snake[max_len - 1][0] -= 1;\r\n    } else if (cur_heading == 2) {\r\n      cur_heading = 3;\r\n      snake[max_len - 1][1] += 1;\r\n    } else if (cur_heading == 3) {\r\n      cur_heading = 0;\r\n      snake[max_len - 1][0] += 1;\r\n    }\r\n    move_left = 0;\r\n  } else if (move_right == 1) {\r\n    if (cur_heading == 0) {\r\n      cur_heading = 3;\r\n      snake[max_len - 1][1] += 1;\r\n    } else if (cur_heading == 1) {\r\n      cur_heading = 0;\r\n      snake[max_len - 1][0] += 1;\r\n    } else if (cur_heading == 2) {\r\n      cur_heading = 1;\r\n      snake[max_len - 1][1] -= 1;\r\n    } else if (cur_heading == 3) {\r\n      cur_heading = 2;\r\n      snake[max_len - 1][0] -= 1;\r\n    }\r\n    move_right = 0;\r\n  } else {\r\n    if (cur_heading == 0) {\r\n      snake[max_len - 1][0] += 1;\r\n    } else if (cur_heading == 1) {\r\n      snake[max_len - 1][1] -= 1;\r\n    } else if (cur_heading == 2) {\r\n      snake[max_len - 1][0] -= 1;\r\n    } else if (cur_heading == 3) {\r\n      snake[max_len - 1][1] += 1;\r\n    }\r\n  }\r\n}\r\n\r\n\/\/ Function to generate a blob and draw the blob on the gamescene\r\nvoid blob_generator() {\r\n  \/\/ If blob is eaten by the snake, generate one\r\n  if (is_eaten) {\r\n    blob[0] = random(1, 9);\r\n    blob[1] = random(1, 9);\r\n  }\r\n\r\n  \/\/ Draw the blob on the gamescene\r\n  scene[blob[0] - 1] |= (1 &lt;&lt; (blob[1] - 1));\r\n  is_eaten = 0;\r\n}\r\n\r\n\/\/ Function to redraw the gamescene to the LED matrix with updated variables\r\nvoid refresh_scene() {\r\n  for (int i = 0; i &lt; 8; i++)\r\n    scene[i] = 0x00;\r\n  snake_move();\r\n  spawn_snake();\r\n  blob_generator();\r\n  for (int i = 1; i &lt; 9; i++)\r\n    SendData(i, scene[i - 1]);\r\n}\r\n\r\n\/\/ Callback for interrupt attached to left button\r\nvoid update_left() {\r\n  move_left = 1;\r\n}\r\n\r\n\/\/ Callback for interrupt attached to right button\r\nvoid update_right() {\r\n  move_right = 1;\r\n}\r\n\r\n\/\/ Setup function\r\nvoid setup() {\r\n  \/\/ GPIO Configuration\r\n  pinMode(left_button, INPUT_PULLUP);\r\n  pinMode(right_button, INPUT_PULLUP);\r\n  pinMode(CS, OUTPUT);\r\n  \r\n  \/\/ SPI configuration\r\n  SPI.setBitOrder(MSBFIRST);     \/\/ Most significant bit first\r\n  SPI.begin();                   \/\/ Start SPI\r\n  SendData(DISPLAY_TEST, 0x00);  \/\/ Finish test mode.\r\n  SendData(DECODE_MODE, 0x00);   \/\/ Disable BCD mode.\r\n  SendData(INTENSITY, 0x0F);     \/\/ Use MAX intensity. (F = 15)\r\n  SendData(SCAN_LIMIT, 0x0f);    \/\/ Scan all digits.\r\n  SendData(SHUTDOWN, 0x01);      \/\/ Turn on chip.\r\n\r\n  \/\/ Random seed generation...Uses the noise in the analog channel 0 to create a random seed\r\n  randomSeed(analogRead(0));\r\n\r\n  \/\/ Attach interrupts to the buttons\r\n  attachInterrupt(digitalPinToInterrupt(left_button), update_left, FALLING);\r\n  attachInterrupt(digitalPinToInterrupt(right_button), update_right, FALLING);\r\n\r\n  \/\/ Enable interrupt\r\n  sei();\r\n\r\n  \/\/ Start the game\r\n  init_game();\r\n}\r\n\r\nvoid loop() {\r\n  \/\/ Check if snake is at max length\r\n  if (snake_l == max_len) {\r\n    \/\/ If yes, display win and restart\r\n    byte win_scene[8] = { B11100011, B00100100, B01000010, B11100100, B00000011, 0, B00011100, 0 };\r\n    for (int i = 1; i &lt; 9; i++)\r\n      SendData(i, win_scene[i - 1]);\r\n    delay(5000);\r\n    init_game();\r\n  }\r\n\r\n  \/\/ Check if snake has collided with itself\r\n  for (int i = 0; i &lt; max_len - 1; i++) {\r\n    if (snake[i][0] == snake[max_len - 1][0] &amp;&amp; snake[i][1] == snake[max_len - 1][1]) {\r\n      \/\/ If yes, blink all leds and restart the game\r\n      delay(1000);\r\n      for (int j = 0; j &lt; 4; j++) {\r\n        SendData(DISPLAY_TEST, 0x01);\r\n        delay(500);\r\n        SendData(DISPLAY_TEST, 0x00);\r\n        delay(500);\r\n      }\r\n      init_game();\r\n      break;\r\n    }\r\n  }\r\n  \r\n  \/\/ Keep refreshing the matrix with updated data....\r\n  refresh_scene();\r\n  \/\/ ...Every 0.5 secs\r\n  delay(250);\r\n}<\/pre>\n<h2>Resultado do projeto<\/h2>\n<p>Acompanhe nossos v\u00eddeos nas redes sociais <a href=\"https:\/\/www.instagram.com\/usinainfo\/\">@usinainfo<\/a>.<\/p>\n<div style=\"display: flex; justify-content: center;\">\n<blockquote class=\"instagram-media\" style=\"background: #FFF; border: 0; border-radius: 3px; box-shadow: 0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width: 540px; min-width: 326px; padding: 0; width: calc(100% - 2px);\" data-instgrm-captioned=\"\" data-instgrm-permalink=\"https:\/\/www.instagram.com\/reel\/C7Uct15PX_H\/?utm_source=ig_embed&amp;utm_campaign=loading\" data-instgrm-version=\"14\">\n<div style=\"padding: 16px;\">\n<p>&nbsp;<\/p>\n<div style=\"display: flex; flex-direction: row; align-items: center;\">\n<div style=\"background-color: #f4f4f4; border-radius: 50%; flex-grow: 0; height: 40px; margin-right: 14px; width: 40px;\"><\/div>\n<div style=\"display: flex; flex-direction: column; flex-grow: 1; justify-content: center;\">\n<div style=\"background-color: #f4f4f4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 100px;\"><\/div>\n<div style=\"background-color: #f4f4f4; border-radius: 4px; flex-grow: 0; height: 14px; width: 60px;\"><\/div>\n<\/div>\n<\/div>\n<div style=\"padding: 19% 0;\"><\/div>\n<div style=\"display: block; height: 50px; margin: 0 auto 12px; width: 50px;\"><\/div>\n<div style=\"padding-top: 8px;\">\n<div style=\"color: #3897f0; font-family: Arial,sans-serif; font-size: 14px; font-style: normal; font-weight: 550; line-height: 18px;\">Ver essa foto no Instagram<\/div>\n<\/div>\n<div style=\"padding: 12.5% 0;\"><\/div>\n<div style=\"display: flex; flex-direction: row; margin-bottom: 14px; align-items: center;\">\n<div>\n<div style=\"background-color: #f4f4f4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(0px) translateY(7px);\"><\/div>\n<div style=\"background-color: #f4f4f4; height: 12.5px; transform: rotate(-45deg) translateX(3px) translateY(1px); width: 12.5px; flex-grow: 0; margin-right: 14px; margin-left: 2px;\"><\/div>\n<div style=\"background-color: #f4f4f4; border-radius: 50%; height: 12.5px; width: 12.5px; transform: translateX(9px) translateY(-18px);\"><\/div>\n<\/div>\n<div style=\"margin-left: 8px;\">\n<div style=\"background-color: #f4f4f4; border-radius: 50%; flex-grow: 0; height: 20px; width: 20px;\"><\/div>\n<div style=\"width: 0; height: 0; border-top: 2px solid transparent; border-left: 6px solid #f4f4f4; border-bottom: 2px solid transparent; transform: translateX(16px) translateY(-4px) rotate(30deg);\"><\/div>\n<\/div>\n<div style=\"margin-left: auto;\">\n<div style=\"width: 0px; border-top: 8px solid #F4F4F4; border-right: 8px solid transparent; transform: translateY(16px);\"><\/div>\n<div style=\"background-color: #f4f4f4; flex-grow: 0; height: 12px; width: 16px; transform: translateY(-4px);\"><\/div>\n<div style=\"width: 0; height: 0; border-top: 8px solid #F4F4F4; border-left: 8px solid transparent; transform: translateY(-4px) translateX(8px);\"><\/div>\n<\/div>\n<\/div>\n<div style=\"display: flex; flex-direction: column; flex-grow: 1; justify-content: center; margin-bottom: 24px;\">\n<div style=\"background-color: #f4f4f4; border-radius: 4px; flex-grow: 0; height: 14px; margin-bottom: 6px; width: 224px;\"><\/div>\n<div style=\"background-color: #f4f4f4; border-radius: 4px; flex-grow: 0; height: 14px; width: 144px;\"><\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<p style=\"color: #c9c8cd; font-family: Arial,sans-serif; font-size: 14px; line-height: 17px; margin-bottom: 0; margin-top: 8px; overflow: hidden; padding: 8px 0 7px; text-align: center; text-overflow: ellipsis; white-space: nowrap;\"><a style=\"color: #c9c8cd; font-family: Arial,sans-serif; font-size: 14px; font-style: normal; font-weight: normal; line-height: 17px; text-decoration: none;\" href=\"https:\/\/www.instagram.com\/reel\/C7Uct15PX_H\/?utm_source=ig_embed&amp;utm_campaign=loading\" target=\"_blank\" rel=\"noopener\">Uma publica\u00e7\u00e3o compartilhada por USINAINFO | ELETR\u00d4NICA E ROB\u00d3TICA (@usinainfo)<\/a><\/p>\n<\/div>\n<\/blockquote>\n<\/div>\n<p><script async src=\"\/\/www.instagram.com\/embed.js\"><\/script><\/p>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><\/h2>\n<h2><strong>Funcionamento do jogo da cobrinha<\/strong><\/h2>\n<p>Seu funcionamento \u00e9 bastante simples, utilizamos os bot\u00f5es que est\u00e3o utilizando pull-up por meio do c\u00f3digo do Arduino, assim ativando seus resistores internos. Conforme eles serem pressionados deixam em LOW sua entrada, detectando o clique.<\/p>\n<p>A Matriz de LED 8&#215;8 ir\u00e1 mostrar a cobrinha e as &#8220;comidas&#8221; para crescer, atualmente conta com sistema de perder ao colidir com seu pr\u00f3prio corpo e ganhar ao pegar 15 comidas.<\/p>\n<p>Este jogo \u00e9 bastante customiz\u00e1vel, sendo poss\u00edvel alterar no c\u00f3digo na vari\u00e1vel &#8220;max_len&#8221; para poder crescer mais ainda a cobrinha. Contudo tamb\u00e9m \u00e9 poss\u00edvel alterar a velocidade do jogo, no delay ao final do void loop.<\/p>\n<p>E se voc\u00ea for sagaz, ir\u00e1 conseguir alterar a tela de vit\u00f3ria em &#8220;win_scene&#8221;, contudo, fica o desafio para voc\u00ea maker.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Venha aprender a criar um dos jogos cl\u00e1ssicos do in\u00edcio da era dos celulares, agora em formato DIY com seu Arduino, semelhante ao\u00a0 famoso Jogo da Cobrinha! &nbsp; Sendo um jogo simples, que pode ser feito com poucos componentes e ainda assim garantir bastante divers\u00e3o at\u00e9 os dias de hoje, um jogo atemporal. Este pequeno projeto pode ser o pontap\u00e9 inicial para voc\u00ea deslumbrar do muito Maker e finalmente realizar seus pr\u00f3prios projetos, basta ter criatividade, alguns componentes e m\u00e3o na massa! Material Necess\u00e1rio 1x Arduino UNO R3 + Cabo USB AB; 1x Protoboard; 1x Matriz de LED 8&#215;8; 1x Kit Push Button 12&#215;12 Colorido \/ Chave t\u00e1ctil 12\u00d712; 1x Jumper Macho-Macho; 1x Jumper Macho-F\u00eamea; 1x Jumper R\u00edgidos (Opcional, para [&hellip;]<\/p>\n","protected":false},"author":24,"featured_media":6550,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10,1],"tags":[340,341,282],"class_list":["post-6536","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-projetos","tag-jogo-com-arduino","tag-jogo-da-cobrinha","tag-matriz-de-led-8x8"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Jogo da cobrinha DIY - Com matriz de LED - Blog Usinainfo<\/title>\n<meta name=\"description\" content=\"Aprenda a criar Jogo da Cobrinha DIY com Arduino! Este tutorial ensina como usar uma matriz de LED com Arduino Uno criando jogo da cobrinha!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Jogo da cobrinha DIY - Com matriz de LED - Blog Usinainfo\" \/>\n<meta property=\"og:description\" content=\"Aprenda a criar Jogo da Cobrinha DIY com Arduino! Este tutorial ensina como usar uma matriz de LED com Arduino Uno criando jogo da cobrinha!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog Usinainfo\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/pt-br.facebook.com\/faceusinainfo\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-02T19:20:03+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-10T12:43:43+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.usinainfo.com.br\/blog\/wp-content\/uploads\/2024\/07\/Novo-Projeto-3.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"2560\" \/>\n\t<meta property=\"og:image:height\" content=\"1920\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Victor Eduardo Ferreira\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"Victor Eduardo Ferreira\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. tempo de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutos\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Jogo da cobrinha DIY - Com matriz de LED - Blog Usinainfo","description":"Aprenda a criar Jogo da Cobrinha DIY com Arduino! Este tutorial ensina como usar uma matriz de LED com Arduino Uno criando jogo da cobrinha!","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":"https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/","og_locale":"pt_BR","og_type":"article","og_title":"Jogo da cobrinha DIY - Com matriz de LED - Blog Usinainfo","og_description":"Aprenda a criar Jogo da Cobrinha DIY com Arduino! Este tutorial ensina como usar uma matriz de LED com Arduino Uno criando jogo da cobrinha!","og_url":"https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/","og_site_name":"Blog Usinainfo","article_publisher":"https:\/\/pt-br.facebook.com\/faceusinainfo\/","article_published_time":"2024-07-02T19:20:03+00:00","article_modified_time":"2025-01-10T12:43:43+00:00","og_image":[{"width":2560,"height":1920,"url":"https:\/\/www.usinainfo.com.br\/blog\/wp-content\/uploads\/2024\/07\/Novo-Projeto-3.jpg","type":"image\/jpeg"}],"author":"Victor Eduardo Ferreira","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"Victor Eduardo Ferreira","Est. tempo de leitura":"3 minutos"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/","url":"https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/","name":"Jogo da cobrinha DIY - Com matriz de LED - Blog Usinainfo","isPartOf":{"@id":"https:\/\/www.usinainfo.com.br\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/#primaryimage"},"image":{"@id":"https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/#primaryimage"},"thumbnailUrl":"https:\/\/www.usinainfo.com.br\/blog\/wp-content\/uploads\/2024\/07\/Novo-Projeto-3.jpg","datePublished":"2024-07-02T19:20:03+00:00","dateModified":"2025-01-10T12:43:43+00:00","author":{"@id":"https:\/\/www.usinainfo.com.br\/blog\/#\/schema\/person\/42af7dcaf36388e9c09e502d5c37ccf4"},"description":"Aprenda a criar Jogo da Cobrinha DIY com Arduino! Este tutorial ensina como usar uma matriz de LED com Arduino Uno criando jogo da cobrinha!","breadcrumb":{"@id":"https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/#primaryimage","url":"https:\/\/www.usinainfo.com.br\/blog\/wp-content\/uploads\/2024\/07\/Novo-Projeto-3.jpg","contentUrl":"https:\/\/www.usinainfo.com.br\/blog\/wp-content\/uploads\/2024\/07\/Novo-Projeto-3.jpg","width":2560,"height":1920,"caption":"Jogo da Cobrinha DIY"},{"@type":"BreadcrumbList","@id":"https:\/\/www.usinainfo.com.br\/blog\/jogo-da-cobrinha-diy-com-matriz-de-led\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/www.usinainfo.com.br\/blog\/"},{"@type":"ListItem","position":2,"name":"Jogo da cobrinha DIY &#8211; Com matriz de LED"}]},{"@type":"WebSite","@id":"https:\/\/www.usinainfo.com.br\/blog\/#website","url":"https:\/\/www.usinainfo.com.br\/blog\/","name":"Blog Usinainfo","description":"Usinainfo","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.usinainfo.com.br\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Person","@id":"https:\/\/www.usinainfo.com.br\/blog\/#\/schema\/person\/42af7dcaf36388e9c09e502d5c37ccf4","name":"Victor Eduardo Ferreira","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/www.usinainfo.com.br\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/30594505903ea0d000e635c10575bea675834a0dddfbba4b8d586a18aed204f9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/30594505903ea0d000e635c10575bea675834a0dddfbba4b8d586a18aed204f9?s=96&d=mm&r=g","caption":"Victor Eduardo Ferreira"},"description":"Sou programador e estudante de eletr\u00f4nica, busco explorar como as coisas funcionam \ud83d\udca1","sameAs":["https:\/\/www.youtube.com\/@rc0d3"],"url":"https:\/\/www.usinainfo.com.br\/blog\/author\/victor\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.usinainfo.com.br\/blog\/wp-json\/wp\/v2\/posts\/6536","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.usinainfo.com.br\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.usinainfo.com.br\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.usinainfo.com.br\/blog\/wp-json\/wp\/v2\/users\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/www.usinainfo.com.br\/blog\/wp-json\/wp\/v2\/comments?post=6536"}],"version-history":[{"count":15,"href":"https:\/\/www.usinainfo.com.br\/blog\/wp-json\/wp\/v2\/posts\/6536\/revisions"}],"predecessor-version":[{"id":6763,"href":"https:\/\/www.usinainfo.com.br\/blog\/wp-json\/wp\/v2\/posts\/6536\/revisions\/6763"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.usinainfo.com.br\/blog\/wp-json\/wp\/v2\/media\/6550"}],"wp:attachment":[{"href":"https:\/\/www.usinainfo.com.br\/blog\/wp-json\/wp\/v2\/media?parent=6536"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.usinainfo.com.br\/blog\/wp-json\/wp\/v2\/categories?post=6536"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.usinainfo.com.br\/blog\/wp-json\/wp\/v2\/tags?post=6536"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}