{"id":3271,"date":"2023-11-01T08:19:25","date_gmt":"2023-11-01T08:19:25","guid":{"rendered":"https:\/\/vegaprocessors.in\/blog\/?p=3271"},"modified":"2023-11-07T05:28:44","modified_gmt":"2023-11-07T05:28:44","slug":"play-tic-tac-toe-on-oled-display-using-vega-aries-board","status":"publish","type":"post","link":"https:\/\/vegaprocessors.in\/blog\/play-tic-tac-toe-on-oled-display-using-vega-aries-board\/","title":{"rendered":"Play Tic-Tac-Toe on OLED Display using VEGA ARIES Board"},"content":{"rendered":"\n<p>The game is to be played between two people (in this program between HUMAN and COMPUTER). One of the players chooses \u2018O\u2019 and the other \u2018X\u2019 to mark their respective cells. The game starts with one of the players and the game ends when one of the players has one whole row\/ column\/ diagonal filled with his\/her respective character (\u2018O\u2019 or \u2018X\u2019). If no one wins, then the game is said to be draw.&nbsp; <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Windows 10 or above\/Linux (64 bit)<\/li>\n\n\n\n<li>Arduino IDE<\/li>\n\n\n\n<li><a href=\"https:\/\/vegaprocessors.in\/devboards\/ariesv2.php\" target=\"_blank\" rel=\"noreferrer noopener\">VEGA ARIES Board support package<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><a href=\"https:\/\/vegaprocessors.in\/blog\/simple-pong-game-on-led-matrix-using-aries-v3-0-board\/#hardware-required\"><\/a>Hardware Required<\/h2>\n\n\n\n<p>This project can be done without OLED display, for that refer <a href=\"https:\/\/vegaprocessors.in\/blog\/play-tic-tac-toe-on-serial-monitor-using-vega-aries-board\/\" data-type=\"link\" data-id=\"https:\/\/vegaprocessors.in\/blog\/play-tic-tac-toe-on-serial-monitor-using-vega-aries-board\/\">tic-tac-toe on serial monitor<\/a>.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ARIES v2.0 Board<\/li>\n\n\n\n<li>I2C 0.96&#8243; OLED Display &#8211; SSD1306<\/li>\n\n\n\n<li>Jumper Wires<\/li>\n\n\n\n<li>Micro USB type B to USB type A cable<\/li>\n<\/ul>\n\n\n\n<p><strong>Not<\/strong><strong>e:<\/strong> &nbsp;All of the following boards can be used for this project<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/vegaprocessors.in\/devboards\/ariesv2.php\">ARIES v2.0<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/vegaprocessors.in\/devboards\/ariesv3.php\">ARIES v3.0<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/vegaprocessors.in\/devboards\/ariesmicro.php\">ARIES Micro<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/vegaprocessors.in\/devboards\/ariesdot.php\">ARIES DOT<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/vegaprocessors.in\/devboards\/ariesiot.php\">ARIES IoT<\/a><\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Libraries Required<\/h2>\n\n\n\n<p>Download the&nbsp;<strong><a href=\"https:\/\/github.com\/adafruit\/Adafruit_SSD1306\">Adafruit SSD1306<\/a><\/strong>&nbsp;library and its dependencies from&nbsp;<strong>Tools -&gt; Manage Libraries\u2026<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"304\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/libraryRequired-1024x304.png\" alt=\"\" class=\"wp-image-3273\" style=\"width:839px;height:249px\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/libraryRequired-1024x304.png 1024w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/libraryRequired-300x89.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/libraryRequired-768x228.png 768w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/libraryRequired-1536x456.png 1536w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/libraryRequired-2048x608.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Circuit Diagram<\/h2>\n\n\n\n<p>Now let\u2019s connect the SSD1306 OLED display module to the ARIES v2.0 board.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"960\" height=\"540\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/tic-tac-toe.png\" alt=\"\" class=\"wp-image-3276\" style=\"width:670px;height:377px\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/tic-tac-toe.png 960w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/tic-tac-toe-300x169.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/tic-tac-toe-768x432.png 768w\" sizes=\"auto, (max-width: 960px) 100vw, 960px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Connections<\/h2>\n\n\n\n<p>The connection between ARIES v2.0 board &amp; OLED display is as follow.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td><strong>OLED Display SSD1306<\/strong><\/td><td><strong>ARIES V2.0 Board<\/strong><\/td><\/tr><tr><td>VCC<\/td><td>3.3V<\/td><\/tr><tr><td>GND<\/td><td>GND<\/td><\/tr><tr><td>SCL<\/td><td>SCL-1<\/td><\/tr><tr><td>SDA<\/td><td>SDA-1<\/td><\/tr><\/tbody><\/table><figcaption class=\"wp-element-caption\"><strong><em>Connection pins for OLED display &amp; ARIES v2.0 board<\/em><\/strong><\/figcaption><\/figure>\n\n\n\n<p><strong><em>Note<\/em><\/strong>: <em>If you&#8217;re using ARIES v3 board, external PUSH buttons are required.<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Procedure<\/h2>\n\n\n\n<p>Once we\u2019re done with the connections, let\u2019s power up the board. Make sure the Laptop\/Desktop\/PC which we\u2019re using should be pre-installed with Arduino IDE and VEGA ARIES boards of latest version.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Now,&nbsp;<strong>Open&nbsp;<\/strong>the Arduino IDE<\/li>\n\n\n\n<li>Make sure you have selected&nbsp;ARIES v2&nbsp;Board from&nbsp;<strong>Tools<\/strong>&nbsp;-&gt;&nbsp;<strong>Board<\/strong>&nbsp;-&gt;&nbsp;<strong>VEGA Processor: ARIES Boards<\/strong>&nbsp;-&gt;&nbsp;<strong>ARIES v2<\/strong><\/li>\n\n\n\n<li>Select Programmer as VEGA XMODEM from&nbsp;<strong>Tools<\/strong>&nbsp;-&gt;&nbsp;<strong>Programmer<\/strong>&nbsp;-&gt;&nbsp;<strong>VEGA XMODEM<\/strong><\/li>\n\n\n\n<li>Also select appropriate port,\u00a0<strong>Tools<\/strong>\u00a0->\u00a0<strong>Port<\/strong>\u00a0->\u00a0<strong>COM* (ARIES Board)<\/strong><\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"828\" height=\"421\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/11\/ticTacToeOLED.png\" alt=\"\" class=\"wp-image-4481\" style=\"width:661px;height:346px\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/11\/ticTacToeOLED.png 828w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/11\/ticTacToeOLED-300x153.png 300w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/11\/ticTacToeOLED-768x390.png 768w\" sizes=\"auto, (max-width: 828px) 100vw, 828px\" \/><\/figure>\n<\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Open <strong>File<\/strong>&nbsp;-&gt;&nbsp;<strong>Examples<\/strong>&nbsp;-&gt; Under&nbsp;<strong>Examples for ARIES v2<\/strong>&nbsp;-&gt;&nbsp;<strong>Wire<\/strong> -&gt;&nbsp;<strong>OLED_SSD1306 -&gt; tic-tac-toe<\/strong><\/li>\n<\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"758\" height=\"932\" src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/demo.png\" alt=\"\" class=\"wp-image-3281\" style=\"width:480px;height:591px\" srcset=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/demo.png 758w, https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/demo-244x300.png 244w\" sizes=\"auto, (max-width: 758px) 100vw, 758px\" \/><\/figure>\n<\/div>\n\n\n<ul class=\"wp-block-list\">\n<li>Now, <strong>Upload<\/strong> the code in ARIES v2 board.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Output<\/h2>\n\n\n\n<p>Once the code is uploaded, an empty 3&#215;3 grid will display on OLED, right side of display prints &#8220;You&#8221; or &#8220;CPU&#8221;, depends on whose turn it is. It selects the turn randomly. The &#8220;?&#8221; is a pointer and flashing &#8220;?&#8221; means it&#8217;s the player turn. We can move the pointer to the next empty cell by pressing BTN1 and to select the cell BTN0 is use. The game is played with X and O as the two players&#8217; symbols, where X goes for CPU and O goes for You. A player wins the game if they get three of their symbols in a row (horizontally, vertically, or diagonally). If a player successfully forms a winning pattern, they announce their victory. Press BTN0 or BTN1 to reset the game.<\/p>\n\n\n\n<figure class=\"wp-block-video\"><video height=\"1080\" style=\"aspect-ratio: 1696 \/ 1080;\" width=\"1696\" controls src=\"https:\/\/vegaprocessors.in\/blog\/wp-content\/uploads\/2023\/09\/tic_tac_toe.mp4\"><\/video><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>The game is to be played between two people (in this program between HUMAN and COMPUTER). One of the players chooses \u2018O\u2019 and the other \u2018X\u2019 to mark their respective cells. The game starts with one of the players and the game ends when one of the players has one whole row\/ column\/ diagonal filled [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":3272,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[94],"tags":[75,76,66,31,24],"class_list":["post-3271","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-aries-with-arduinoide","tag-aries-v2-board","tag-c-dac","tag-iic","tag-thejas32","tag-vegaprocessor"],"_links":{"self":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/3271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/comments?post=3271"}],"version-history":[{"count":13,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/3271\/revisions"}],"predecessor-version":[{"id":4480,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/posts\/3271\/revisions\/4480"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/media\/3272"}],"wp:attachment":[{"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/media?parent=3271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/categories?post=3271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vegaprocessors.in\/blog\/wp-json\/wp\/v2\/tags?post=3271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}