{"id":20761051,"url":"https://github.com/tophercantrell/fsm","last_synced_at":"2026-05-24T01:32:54.072Z","repository":{"id":85496673,"uuid":"64804520","full_name":"topherCantrell/FSM","owner":"topherCantrell","description":"Declarative Finite State Machines","archived":false,"fork":false,"pushed_at":"2024-09-01T12:06:17.000Z","size":12385,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T12:53:16.692Z","etag":null,"topics":["propeller-spin","raspberry-pi","state-machine","tictactoe"],"latest_commit_sha":null,"homepage":null,"language":"Propeller Spin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/topherCantrell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-03T01:26:08.000Z","updated_at":"2024-09-01T12:06:20.000Z","dependencies_parsed_at":"2025-01-18T05:27:51.617Z","dependency_job_id":"23713d32-0a44-414a-8cd5-fa143bf49688","html_url":"https://github.com/topherCantrell/FSM","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/topherCantrell/FSM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topherCantrell%2FFSM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topherCantrell%2FFSM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topherCantrell%2FFSM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topherCantrell%2FFSM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/topherCantrell","download_url":"https://codeload.github.com/topherCantrell/FSM/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/topherCantrell%2FFSM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33418547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-23T22:14:44.296Z","status":"ssl_error","status_checked_at":"2026-05-23T22:14:43.778Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["propeller-spin","raspberry-pi","state-machine","tictactoe"],"created_at":"2024-11-17T10:17:17.084Z","updated_at":"2026-05-24T01:32:54.038Z","avatar_url":"https://github.com/topherCantrell.png","language":"Propeller Spin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Declarative Finite State Machines\n\n### As seen on Adafruit Show and Tell\n[![](art/adafruit.jpg)](https://www.adafruit.com/) \u003cbr\u003e\nhttps://youtu.be/q3QH9htYY7w?t=445\n\n### As seen on Youtube\n[![](art/youtube.jpg)](https://www.youtube.com/) \u003cbr\u003e\nhttps://www.youtube.com/watch?v=OMaOBdMiC70\n\n### As Seen In Circuit Cellar Magazine\n[![](art/circuitcellar.jpg)](https://circuitcellar.com/)\u003cbr\u003e\nhttps://cc-webshop.com/collections/circuit-cellar-2017/products/circuit-cellar-324-july-2017-pdf\n\n# Links\n8x8 LED Display:\u003cbr\u003e\nhttp://www.adafruit.com/product/902\n\nLED Button (Mouser P/N: 633-15ACBKG036CF-2SJB):\u003cbr\u003e\nhttp://www.mouser.com/search/ProductDetail.aspx?R=0virtualkey0virtualkeyKP0115ACBKG036CF-2SJB\n\nHT16K133 LED Matrix Backpack Driver:\u003cbr\u003e\nhttp://obex.parallax.com/object/747\n\nTic Tac Tome:\u003cbr\u003e\nhttp://www.amazon.com/Tic-Tac-Tome-Autonomous-Playing/dp/1594746877\n\nInstalling node.js on Raspberry Pi:\u003cbr\u003e\nhttps://learn.adafruit.com/node-embedded-development/installing-node-dot-js\n\n# Hardware\n\nHere is the tic-tac-toe state machine in action. The Raspberry Pi is on the left running the state machine in NodeJS (JavaScript). The Parallax Propeller is on the right running the state machine in SPIN. Both platforms use the same hardware. The left button has a wooden sleeve I built for stability.\n![](https://github.com/topherCantrell/FSM/blob/master/art/photo1.jpg)\n\nThe Raspberry Pi playing the Tic Tac Toe Tome. The Pi found the one winning case coded purposefully into the book.\n![](art/photo2.jpg)\n\nThe hardware schematics and connections to the CPUs.\n![](art/figure1.jpg)\n\nAn older version of the hardware running on the Synapse SN171 proto board.\n![](art/SnapTacToe.jpg)\n\n# Tic Tac Toe State Machine\n\nThe bubbles in the diagram below are the individual states. The purple function calls are made when the machine enters the state. The blue arrows show events and the target state.\n\n## Splash Screens\n\nThis part of the state machine is an attract mode. The machine shows the individual letters for the words \"TIC\", \"TAC\", and \"TOE\" and sweeps the display clean with a line between. Press the button to start the game in the \"PICKS\" state.\n\n![](art/TTTFSM1.png)\n\n## Pick a Game\n\nThis part of the machine picks a computer player and decides who goes first.\n \n![](art/TTTFSM2.png)\n\n## Game Play\n\nThis part of the machine includes the player's input loop. You press the button and quickly release it to advance the cursor. If you hold the button down you enter the move. The cursor only stops at available cells. The machine alternates between player and CPU until there is a win or a tie.\n\n![](art/TTTFSM3.png)\n\n## Game Over\n\nThis part of the machine shows the winner of the game. The button flashes the color of the winner (orange for tie) until you press the button. Then the machine returns to the splash mode.\n\n![](art/TTTFSM4.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftophercantrell%2Ffsm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftophercantrell%2Ffsm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftophercantrell%2Ffsm/lists"}