{"id":13802311,"url":"https://github.com/dsiggi/micropython-ad840x","last_synced_at":"2025-05-13T13:30:35.123Z","repository":{"id":93134053,"uuid":"372203811","full_name":"dsiggi/micropython-ad840x","owner":"dsiggi","description":"A MicroPython library for the AD840x digital potentiomers.","archived":false,"fork":false,"pushed_at":"2021-05-30T12:05:45.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-09T14:13:30.222Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dsiggi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-05-30T12:05:12.000Z","updated_at":"2024-05-29T17:00:23.000Z","dependencies_parsed_at":"2023-06-05T02:45:29.676Z","dependency_job_id":null,"html_url":"https://github.com/dsiggi/micropython-ad840x","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsiggi%2Fmicropython-ad840x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsiggi%2Fmicropython-ad840x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsiggi%2Fmicropython-ad840x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsiggi%2Fmicropython-ad840x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsiggi","download_url":"https://codeload.github.com/dsiggi/micropython-ad840x/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253949928,"owners_count":21989273,"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","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":[],"created_at":"2024-08-04T00:01:41.810Z","updated_at":"2025-05-13T13:30:34.784Z","avatar_url":"https://github.com/dsiggi.png","language":"Python","funding_links":[],"categories":["Libraries"],"sub_categories":["IO"],"readme":"# micropython-ad840x\n\nMicropython SPI-based manipulation of the AD series digital potentiometers AD8400, AD8402 and AD8403.\n\nThis has been tested with ESP8266 and ESP32 running Micropython 1.15 on AD8402 only, but should work also with AD8400 and AD8403. Please post an issue if you have success.\n\n## Pins\nYou can connect the AD840x to the following Pins:\n\nPin (AD840x)  | Pin (ESP32)      | Description\n:------------:|:----------------:|:----------------------------------------\nCS    \t      | HSPID (GPIO13)   | Chip Select Input\nCLK           | HSPICLK (GPIO14) | Serial Clock Input\nSDI           | HSPICS0 (GPIO15) | Serial Data Input\n\n\n```python\nfrom machine import SPI\nimport ad840x\n\n#Setting up the SPI system\nspi = SPI(1)\n\n#Initalize the AD840x\npoti_1channel = ad840x.AD8400(spi, cs=15)\npoti_2channel = ad840x.AD8402(spi, cs=16)\npoti_4channel = ad840x.AD8403(spi, cs=17)\n\n#Set Channel 0\npoti_1channel.write(0, 0) #Zero-scale (wiper contact resistance)\npoti_2channel.write(0, 50) #Midscale\npoti_4channel.write(0, 100) #Full scale\n\n#Set Channel 1 in raw mode\npoti_2channel.write_raw(1, 0) #Zero-scale (wiper contact resistance)\npoti_4channel.write_raw(1, 128) #Midscale\n\n#Set Channel 2\npoti_4channel.write(2, 100) #Full scale\n\n#Set Channel 3 in raw mode\npoti_4channel.write(3, 255) #Full scale\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsiggi%2Fmicropython-ad840x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsiggi%2Fmicropython-ad840x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsiggi%2Fmicropython-ad840x/lists"}