{"id":16518836,"url":"https://github.com/dhhagan/dac121c08x","last_synced_at":"2026-06-09T00:31:21.121Z","repository":{"id":72536019,"uuid":"110756128","full_name":"dhhagan/dac121C08X","owner":"dhhagan","description":"C++ library for the Texas Instruments DAC121C085 12-bit DAC IC.","archived":false,"fork":false,"pushed_at":"2017-11-20T16:08:05.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-13T08:11:40.708Z","etag":null,"topics":["c-plus-plus","circuits","particle-electron","particle-photon"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhhagan.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-14T23:17:45.000Z","updated_at":"2017-11-17T18:14:29.000Z","dependencies_parsed_at":"2023-05-24T11:15:17.695Z","dependency_job_id":null,"html_url":"https://github.com/dhhagan/dac121C08X","commit_stats":{"total_commits":4,"total_committers":2,"mean_commits":2.0,"dds":0.25,"last_synced_commit":"e6f23943fb13e27986195270cd031db4630dbe3d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhhagan%2Fdac121C08X","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhhagan%2Fdac121C08X/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhhagan%2Fdac121C08X/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhhagan%2Fdac121C08X/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhhagan","download_url":"https://codeload.github.com/dhhagan/dac121C08X/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241570831,"owners_count":19984001,"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":["c-plus-plus","circuits","particle-electron","particle-photon"],"created_at":"2024-10-11T16:38:28.032Z","updated_at":"2026-06-09T00:31:21.084Z","avatar_url":"https://github.com/dhhagan.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DAC121C08X\n\nA Particle library for the [DAC121C08X](http://www.ti.com/product/DAC121C085?)\n\n## Welcome to your library!\n\nEver need to add more than one 12-bit DAC IC's to your board? Or, is the 3.3V max on the on-board DAC not quite what you're looking for? Look no further! Add up to 8 12-bit micropower DAC with an external reference at once using Texas Instruments' DAC121C085 chip!\n\nTo hook up, simply grab an 8VSSOP breakout board from Adafruit/Sparkfun/Digikey/Mouser and get started!\n\n\n## Usage\n\nConnect the DAC hardware, add the DAC121C08X library to your project and follow this simple example:\n\n```\n#include \"DAC121C08X.h\"\n\nDAC121C08X dac(0x09);\n\nvoid setup() {\n  dac.begin();\n}\n\nvoid loop() {\n  for (int i=0;i\u003c4095;i++) {\n    dac.write_value(i);   // Increment the DAC value\n\n    delay(1000);\n  }\n}\n```\n\nSee the [examples](examples) folder for more details.\n\n## Documentation\n\nThere is only one class with two methods in this (ultra) tiny library.\n\n### `DAC121C08X(uint8_t ADDR, float VREF = 5.0)`\n\nTo initialize an instance of the class, the only requirement is the i2c address. For this chip, the available addresses include: `0xA`, `0xC`, `0xD`, `0xE`, `0x08`, `0x09`, `0x4C`, `0x4D`, and `0x4E`. For specific details, check out the datasheet.\n\nOptionally, you can provide the reference voltage you have wired up; the default value is 5V.\n\n#### `bool DAC121C08X::write_value(unsigned int val)`\n\nTo write a specific value, simply provide an unsigned int between 0-4095 for the 12-bit version. Here, 0 will correspond to 0V and 4095 will correspond to [VREF] volts.\n\n#### `bool DAC121C08X::write_voltage(float voltage)`\n\nRather than have to calculate the number of bits for the voltage you actually want, use this method to do all the (not very) hard work for you. Simply provide a float between 0 and [VREF] volts.\n\n## Contributing\n\nHere's how you can make changes to this library and eventually contribute those changes back.\n\nTo get started, [clone the library from GitHub to your local machine](https://help.github.com/articles/cloning-a-repository/).\n\nChange the name of the library in `library.properties` to something different. You can add your name at then end.\n\nModify the sources in \u003csrc\u003e and \u003cexamples\u003e with the new behavior.\n\nTo compile an example, use `particle compile examples/usage` command in [Particle CLI](https://docs.particle.io/guide/tools-and-features/cli#update-your-device-remotely) or use our [Desktop IDE](https://docs.particle.io/guide/tools-and-features/dev/#compiling-code).\n\nAfter your changes are done you can upload them with `particle library upload` or `Upload` command in the IDE. This will create a private (only visible by you) library that you can use in other projects. Do `particle library add DAC121C08X_myname` to add the library to a project on your machine or add the DAC121C08X_myname library to a project on the Web IDE or Desktop IDE.\n\nAt this point, you can create a [GitHub pull request](https://help.github.com/articles/about-pull-requests/) with your changes to the original library.\n\nIf you wish to make your library public, use `particle library publish` or `Publish` command.\n\n## LICENSE\nCopyright 2017 David H Hagan\n\nLicensed under the MIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhhagan%2Fdac121c08x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhhagan%2Fdac121c08x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhhagan%2Fdac121c08x/lists"}