{"id":15142151,"url":"https://github.com/todbot/pico8enc","last_synced_at":"2025-10-11T20:16:40.622Z","repository":{"id":49330821,"uuid":"355040328","full_name":"todbot/pico8enc","owner":"todbot","description":"Lotsa Rotary Encoders on a Raspberry Pi Pico","archived":false,"fork":false,"pushed_at":"2021-05-07T21:04:55.000Z","size":8879,"stargazers_count":38,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-09-29T23:48:26.494Z","etag":null,"topics":["circuitpython","raspberrypipico","rotary-encoder","rotary-encoders"],"latest_commit_sha":null,"homepage":"","language":"Python","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/todbot.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}},"created_at":"2021-04-06T03:06:10.000Z","updated_at":"2025-07-02T13:39:07.000Z","dependencies_parsed_at":"2022-09-23T18:51:05.912Z","dependency_job_id":null,"html_url":"https://github.com/todbot/pico8enc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/todbot/pico8enc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todbot%2Fpico8enc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todbot%2Fpico8enc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todbot%2Fpico8enc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todbot%2Fpico8enc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/todbot","download_url":"https://codeload.github.com/todbot/pico8enc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/todbot%2Fpico8enc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008580,"owners_count":26084480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["circuitpython","raspberrypipico","rotary-encoder","rotary-encoders"],"created_at":"2024-09-26T09:23:45.872Z","updated_at":"2025-10-11T20:16:40.606Z","avatar_url":"https://github.com/todbot.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pico8enc -- 8 rotary encoders on a Raspberry Pi Pico\n\nTurns out you can hook up 8 rotary encoders w/ switches to\nRaspberry Pi Pico with no extra hardware. Pretty cool!\n\nWith CircuitPython, it becomes pretty easy to actually read these encoders\nsince all hard, timing-critical work is done inside the C-based `rotaryio`\nlibrary that comes standard with CircuitPython.\n\n\u003cimg width=500 src=\"./docs/pico8enc_breadboard.png\"\u003e\n\u003cimg width=500 src=\"./docs/pico8enc_pic1.jpg\"\u003e\n\n\nOne \"twist\" to look out for (haha): the two rotary encoder pins must be hooked up\nto adjacent pins on the Pico, because of how `rotaryio` uses the Pico's\nPIO module to handle reading the encoder pulses.\n\nThe core of the code looks like this:\n```py\nencoder_pins = ( (board.GP12, board.GP13, board.GP16),  # pin A, pin B, pin for switch\n                 (board.GP10, board.GP11, board.GP17),\n                 (board.GP8, board.GP9, board.GP18),\n                 (board.GP6, board.GP7, board.GP19),\n                 # ...\n                 )\nencoders = []\nencoder_buttons = []\nfor pins in encoder_pins:\n    pin_A, pin_B, pin_switch = pins\n    encoder = rotaryio.IncrementalEncoder( pin_A, pin_B )\n    button = DigitalInOut(pin_switch)\n    button.pull = Pull.UP\n    encoders.append(encoder)\n    encoder_buttons.append(button)\n\nwhile True:\n    for i in range(len(encoders)):\n      position = encoders[i].position\n      button_press = encoder_buttons[i].value\n\n```\n\n\u003cimg width=500 src=\"./docs/pico8enclol.jpg\"\u003e\n\u003cimg width=500 src=\"./docs/pico8enc_topshot_gr_1600.jpg\"\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftodbot%2Fpico8enc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftodbot%2Fpico8enc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftodbot%2Fpico8enc/lists"}