[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-0-en-105":3,"doc-seo-510194-105":59,"doc-detail-510194-en":131,"doc-similar-510194":163},{"code":4,"msg":5,"data":6},0,"success",[7,13,18,23,28,33,38,43,48,51,55],{"id":8,"doc_module":4,"doc_module_name":9,"category_name":10,"show_sort_weight":11,"slug":12},1,"Document","Story & Novel",90,"story-novel",{"id":14,"doc_module":4,"doc_module_name":9,"category_name":15,"show_sort_weight":16,"slug":17},2,"Literature",80,"literature",{"id":19,"doc_module":4,"doc_module_name":9,"category_name":20,"show_sort_weight":21,"slug":22},4,"Exam",70,"exam",{"id":24,"doc_module":4,"doc_module_name":9,"category_name":25,"show_sort_weight":26,"slug":27},5,"Comic",60,"comic",{"id":29,"doc_module":4,"doc_module_name":9,"category_name":30,"show_sort_weight":31,"slug":32},6,"Technology",50,"technology",{"id":34,"doc_module":4,"doc_module_name":9,"category_name":35,"show_sort_weight":36,"slug":37},7,"Healthcare",40,"healthcare",{"id":39,"doc_module":4,"doc_module_name":9,"category_name":40,"show_sort_weight":41,"slug":42},8,"Research & Report",30,"research-report",{"id":44,"doc_module":4,"doc_module_name":9,"category_name":45,"show_sort_weight":46,"slug":47},9,"Religion & Spirituality",20,"religion-spirituality",{"id":46,"doc_module":4,"doc_module_name":9,"category_name":49,"show_sort_weight":46,"slug":50},"World Cup","world-cup",{"id":52,"doc_module":4,"doc_module_name":9,"category_name":53,"show_sort_weight":52,"slug":54},10,"Lifestyle","lifestyle",{"id":56,"doc_module":4,"doc_module_name":9,"category_name":57,"show_sort_weight":24,"slug":58},19,"General","general",{"code":4,"msg":60,"data":61},"ok",{"site_id":62,"language":63,"slug":64,"title":65,"keywords":66,"description":67,"schema_data":68,"social_meta":124,"head_meta":126,"extra_data":128,"updated_unix":130},105,"en","clue-dice-roller-overview-set-up-circuitpython-quick-start-code","CLUE Dice Roller - Overview - Set up CircuitPython Quick Start! - Code","","Universal dice-rolling setup for the Adafruit CLUE device, turning a microcontroller into a tabletop “dice roller” driven by code. The guide explains how to install and configure CircuitPython on CLUE, covering USB data requirements, disk drive transitions (CLUEBOOT to CIRCUITPY), and initial files on the device. It then introduces the full project code structure, including constants for number-of-dice limits, supported dice sides, and two operational modes for selecting values and displaying roll results.",{"@graph":69,"@context":123},[70,84,106],{"@type":71,"itemListElement":72},"BreadcrumbList",[73,77,79,82],{"item":74,"name":75,"@type":76,"position":8},"https://docshare.wps.com","Home","ListItem",{"item":78,"name":9,"@type":76,"position":14},"https://docshare.wps.com/document/",{"item":80,"name":30,"@type":76,"position":81},"https://docshare.wps.com/document/technology/",3,{"item":83,"name":65,"@type":76,"position":19},"https://docshare.wps.com/document/clue-dice-roller-overview-set-up-circuitpython-quick-start-code/510194/",{"url":83,"name":65,"@type":85,"image":86,"author":91,"headline":65,"publisher":94,"fileFormat":97,"inLanguage":63,"description":67,"dateModified":98,"datePublished":99,"encodingFormat":97,"isAccessibleForFree":100,"interactionStatistic":101},"DigitalDocument",{"url":87,"@type":88,"width":89,"height":90},"https://docshare.wps.com/thumbnails/clue-dice-roller-overview-set-up-circuitpython-quick-start-code/510194.png","ImageObject",300,407,{"name":92,"@type":93},"Jordan Avery","Person",{"url":74,"name":95,"@type":96},"DocShare","Organization","application/pdf","2026-11-19","2026-10-05",true,{"@type":102,"interactionType":103,"userInteractionCount":105},"InteractionCounter",{"@type":104},"ViewAction",13,{"@type":107,"mainEntity":108},"FAQPage",[109,115,119],{"name":110,"@type":111,"acceptedAnswer":112},"What is the goal of the CLUE Dice Roller guide?","Question",{"text":113,"@type":114},"It shows how to configure a CLUE device to roll dice using CircuitPython code, so the device becomes a universal dice roller for games.","Answer",{"name":116,"@type":111,"acceptedAnswer":117},"How do you install CircuitPython on CLUE?",{"text":118,"@type":114},"Plug in CLUE with a known-good data USB cable, double-click the board reset button to enter boot mode, copy the .uf2 file to CLUEBOOT, then confirm it reappears as CIRCUITPY.",{"name":120,"@type":111,"acceptedAnswer":121},"What are the two modes used by the project code?",{"text":122,"@type":114},"The code uses a selecting mode to set the dice count and side, and a roll-result mode to display the most recent roll outcome.","https://schema.org",{"og:url":83,"og:type":125,"og:title":65,"og:site_name":95,"og:description":67},"article",{"robots":127,"canonical":83},"index,follow",{"doc_id":129,"site_id":62},510194,1791327655,{"code":4,"msg":5,"data":132},{"doc_id":129,"user_id":133,"nickname":92,"user_avatar":134,"doc_module":4,"category_id":29,"category_name":30,"doc_title":65,"doc_description":67,"doc_content":135,"file_id":136,"file_url":137,"file_type":138,"file_size":139,"view_count":105,"is_deleted":4,"is_public":8,"is_downloadable":8,"audit_status":8,"page_count":105,"language":140,"language_code":63,"site_id":62,"html_lang":63,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":67,"update_tm":144,"read_time":145,"preview_page_count":19,"preview_urls":146},1099523882367,"https://ap-avatar.wpscdn.com/davatar_9964176cb1d06d4a9deccf72a44ae3dc","CLUE Dice Roller  \nCreated by Dave Astels  \n[https://learn.adafruit.com/clue-dice-roller](https://learn.adafruit.com/clue-dice-roller)  \nLast updated on 2025-02-24 02:28:42 PM EST  \n©Adafruit Industries Page 1 of 13  \nTable of Contents  \nOverview 3  \n\n| • Parts\u003Cbr>CircuitPython on CLUE | 4 |\n| --- | --- |\n| • Set up CircuitPython Quick Start!\u003Cbr>Code | 6 |\n| • Set up\u003Cbr>• Dealing with buttons\u003Cbr>• The display\u003Cbr>• Roll the bones\u003Cbr>• Updating the selection values\u003Cbr>• Preparing to run\u003Cbr>• The main loop\u003Cbr>• Installing Project Code\u003Cbr>Roll with it | 13 |\n\n©Adafruit Industries Page 2 of 13  \nOverview  \nHow many times have you been sitting at the game table and needing to roll some dice. But you forgot to bring yours and the dice box is on the other side of the table. All you have within reach is a CLUE (maybe in a snazzy case ([https://adafru.it/JhE](https://adafru.it/JhE))). If only there was a way to roll dice with your CLUE.  \nThere is. All you need is the code in this guide. Read on to see how to set your CLUE up as a universal set of dice.  \nParts  \nAdafruit CLUE-nRF52840 Express with Bluetooth LE  \nDo you feel like you just don't have a CLUE? Well, we can help with that-get a CLUE here at Adafruit by picking up this sensor-packed development board. We wanted to build some    \n[https://www.adafruit.com/product/4500](https://www.adafruit.com/product/4500)  \n©Adafruit Industries Page 3 of 13  \nUSB cable-USB A to Micro-B  \nThis here is your standard A to micro-BUSB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or...  \n[https://www.adafruit.com/product/592](https://www.adafruit.com/product/592)  \nCircuitPython on CLUE  \nCircuitPython ([https://adafru.it/tB7](https://adafru.it/tB7)) is a derivative of MicroPython ([https://adafru.it/BeZ](https://adafru.it/BeZ))  \ndesigned to simplify experimentation and education on low-cost microcontrollers. It makes it easier than ever to get prototyping by requiring no upfront desktop software downloads. Simply copy and edit files on the CIRCUITPY flash drive to iterate.  \nThe following instructions will show you how to install CircuitPython. If you've already installed CircuitPython but are looking to update it or reinstall it, the same steps work for that as well!  \nSet up CircuitPython Quick Start!  \nFollow this quick step-by-step for super-fast Python power :)  \nDownload the latest version of CircuitPython for CLUE from [circuitpython.org](circuitpython.org)  \n[https://adafru.it/IHF](https://adafru.it/IHF)  \nClick the link above to download the latest version of CircuitPython for the  \nCLUE.  \nDownload and save it to your desktop (or wherever is handy) .  \n©Adafruit Industries Page 4 of 13  \nPlug your CLUE into your computer using a known-good USB cable.  \nA lot of people end up using charge-only USB cables and it is very frustrating! So make sure you have a USB cable you know is good for data sync.  \nDouble-click the Reset button on the top (magenta arrow) on your board, and you will see the NeoPixel RGB LED (green arrow) turn green. If it turns red, check the USB cable, try another USB port, etc. Note: The little red LED next to the USB connector will pulse red. That's ok!  \nIf double-clicking doesn't work the first time, try again. Sometimes it can take a few tries to get the rhythm right!  \nYou will see a new disk drive appear called CLUEBOOT.  \nDrag the adafruit-circuitpython-clueetc. uf2 file to CLUEBOOT.  \n©Adafruit Industries Page 5 of 13  \nThe LED will flash. Then, the CLUEBOOT drive will disappear and a new disk drive called CIRCUITPY will appear.  \nIf this is the first time you're installing CircuitPython or you're doing a completely fresh install after erasing the filesystem, you will have two files-boot_out.txt , and [code.py](code.py), and one folder- lib on your CIRCUITPY drive.  \nIf CircuitPython was already installed, the files present before reloading CircuitPython should still be present on your CIRCUITPY","cbCaibeFwUDE6glO","https://ap.wps.com/l/cbCaibeFwUDE6glO","pdf",871529,"English","# Overview\n# Parts\n## CircuitPython on CLUE\n# Set up CircuitPython Quick Start!\n## Code\n# Roll with it","[{\"question\":\"What is the goal of the CLUE Dice Roller guide?\",\"answer\":\"It shows how to configure a CLUE device to roll dice using CircuitPython code, so the device becomes a universal dice roller for games.\"},{\"question\":\"How do you install CircuitPython on CLUE?\",\"answer\":\"Plug in CLUE with a known-good data USB cable, double-click the board reset button to enter boot mode, copy the .uf2 file to CLUEBOOT, then confirm it reappears as CIRCUITPY.\"},{\"question\":\"What are the two modes used by the project code?\",\"answer\":\"The code uses a selecting mode to set the dice count and side, and a roll-result mode to display the most recent roll outcome.\"}]","CLUE Dice Roller - Overview - Set up CircuitPython Quick Start! - Code | PDF",1791239608,33,[147,151,155,159],{"page_no":8,"url":148,"width":149,"height":150},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/a6781313e4586d4dbaeacab97a2b41ed.webp",983,1390,{"page_no":14,"url":152,"width":153,"height":154},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/385fd0ffa41a3beb30ba1591fa63284e.webp",982,1388,{"page_no":81,"url":156,"width":157,"height":158},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/7993067335c4f456e4e181acd5430017.webp",981,1387,{"page_no":19,"url":160,"width":161,"height":162},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-17/e1c113b82760e0a6eb9b4bf391f35d08.webp",980,1385,{"list":164,"token":66},[165,171,177,183,189,195,201,207,213,219],{"doc_id":166,"doc_title":167,"file_type":138,"home_preview_img_url":168,"slug":169,"view_count":29,"category_name":30,"create_tm":170},720128,"74HC595 Shift Register - CircuitPython Shift Register Usage Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230024384362/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796113799&Signature=ooZ%2FuhiOu1f3Y4ncSdcTP8T9Ef8%3D","74hc595-shift-register-circuitpython-shift-register-usage-guide",1795034707,{"doc_id":172,"doc_title":173,"file_type":138,"home_preview_img_url":174,"slug":175,"view_count":34,"category_name":30,"create_tm":176},720403,"Adafruit Metro RP2350 - Board setup and CircuitPython guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023673595/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796113799&Signature=GPi9w76q06%2FAGC3kbslFRjI1RcA%3D","adafruit-metro-rp2350-board-setup-and-circuitpython-guide",1795037124,{"doc_id":178,"doc_title":179,"file_type":138,"home_preview_img_url":180,"slug":181,"view_count":81,"category_name":30,"create_tm":182},688813,"Where's My Friend? A Location-Aware Display with PyPortal and ItsaSnap","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000667425/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796113799&Signature=B1IHyHZuVjmDnsevasRd1uSf7VY%3D","wheres-my-friend-a-location-aware-display-with-pyportal-and-itsasnap",1794091851,{"doc_id":184,"doc_title":185,"file_type":138,"home_preview_img_url":186,"slug":187,"view_count":34,"category_name":30,"create_tm":188},720517,"Adafruit BNO055 Absolute Orientation Sensor - Setup, Orientation Data, and Calibration Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230024397763/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796113799&Signature=uLryk9Lz7ul4vC6zg%2FqykWVBscg%3D","adafruit-bno055-absolute-orientation-sensor-setup-orientation-data-and-calibration-guide",1795037682,{"doc_id":190,"doc_title":191,"file_type":138,"home_preview_img_url":192,"slug":193,"view_count":24,"category_name":30,"create_tm":194},687489,"Using the CircuitPython Extension for Visual Studio Code","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230001261419/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796113799&Signature=rzi7ZMTubaPIhr4eisLzwX3ZPNk%3D","using-the-circuitpython-extension-for-visual-studio-code",1794083814,{"doc_id":196,"doc_title":197,"file_type":138,"home_preview_img_url":198,"slug":199,"view_count":52,"category_name":30,"create_tm":200},510183,"Legend Roller - App Introduction","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229934863070/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796113799&Signature=3GLjl4c0AVIPFtqON8AxybsRb8Q%3D","legend-roller-app-introduction",1791239591,{"doc_id":202,"doc_title":203,"file_type":138,"home_preview_img_url":204,"slug":205,"view_count":34,"category_name":30,"create_tm":206},720588,"MCP4725 12-Bit DAC Tutorial","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230024400689/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796113799&Signature=qCdN0cQMy9Ghns2rA96lETtmQlk%3D","mcp4725-12-bit-dac-tutorial-720588",1795038320,{"doc_id":208,"doc_title":209,"file_type":138,"home_preview_img_url":210,"slug":211,"view_count":24,"category_name":30,"create_tm":212},720510,"Adafruit BNO055 Library Documentation - Release 1.0 - Installation and Dependencies","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230023674445/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796113799&Signature=xHS3jPoR0lM1ve5Qwni%2Bm6iGYJY%3D","adafruit-bno055-library-documentation-release-10-installation-and-dependencies",1795037659,{"doc_id":214,"doc_title":215,"file_type":138,"home_preview_img_url":216,"slug":217,"view_count":34,"category_name":30,"create_tm":218},691511,"Adafruit MLX90640 IR Thermal Camera","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230002678685/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796113799&Signature=t%2FmvsPc91hU1pwCHEJ9P2AyLlyc%3D","adafruit-mlx90640-ir-thermal-camera",1794174814,{"doc_id":220,"doc_title":221,"file_type":138,"home_preview_img_url":222,"slug":223,"view_count":19,"category_name":30,"create_tm":224},735319,"Universal Remote Instruction Manual - Setup","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230034332095/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796113799&Signature=izz2I43SXCuVivH%2FQRS7BDeJIm4%3D","universal-remote-instruction-manual-setup",1795458634]