{"id":21944262,"url":"https://github.com/michaelkrone/attiny-pid","last_synced_at":"2025-04-22T21:04:57.533Z","repository":{"id":55608018,"uuid":"129560377","full_name":"michaelkrone/attiny-pid","owner":"michaelkrone","description":"ATTiny85 I2C controllable PID controller","archived":false,"fork":false,"pushed_at":"2020-12-18T11:57:43.000Z","size":32,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-22T21:04:45.671Z","etag":null,"topics":["attiny85","i2c","pid-control"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michaelkrone.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}},"created_at":"2018-04-14T22:57:17.000Z","updated_at":"2024-09-25T02:28:30.000Z","dependencies_parsed_at":"2022-08-15T04:20:16.497Z","dependency_job_id":null,"html_url":"https://github.com/michaelkrone/attiny-pid","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkrone%2Fattiny-pid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkrone%2Fattiny-pid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkrone%2Fattiny-pid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michaelkrone%2Fattiny-pid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michaelkrone","download_url":"https://codeload.github.com/michaelkrone/attiny-pid/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250324690,"owners_count":21411945,"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":["attiny85","i2c","pid-control"],"created_at":"2024-11-29T04:15:14.241Z","updated_at":"2025-04-22T21:04:57.506Z","avatar_url":"https://github.com/michaelkrone.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ATTiny85 PID Controller\n\nThis library provides an I2C controllable ATTiny85 PID controller.\n\n### Two pin control\n| Function | Name | ATTiny85 | Olimexino85 |\n|----------|------|-------------|----------|\n| SCL | PB2 | 7 | 2 |\n| SDA | PB0 | 5 | 0 |\n| MOTOR_UP | PB1\u003csup\u003e1\u003c/sup\u003e | 6 | 1 |\n| MOTOR_DOWN | PB4\u003csup\u003e2\u003c/sup\u003e | 3 | 4 |\n| SIGNAL_READ | A3 | 2 | 3 |\n\n\u003csup\u003e1\u003c/sup\u003ePWM on timer 0; ~500 Hz\n\n\u003csup\u003e2\u003c/sup\u003ePWM on timer 1; ~1000Hz\n\n### Three pin control\n| Function | Name | ATTiny85 | Olimexino85 |\n|----------|------|----------|-------------|\n| SCL | PB2 | 7 | 2 |\n| SDA | PB0 | 5 | 0 |\n| MOTOR_UP | PB5/#RESET | 1 | #RST |\n| MOTOR_DOWN | PB4 | 3 | 4 |\n| MOTOR_SPEED | PB1\u003csup\u003e1\u003c/sup\u003e | 6 | 1 |\n| SIGNAL_READ | A3 | 2 | 3 |\n\n\u003csup\u003e1\u003c/sup\u003ePWM on timer 0; ~500 Hz\n\nThe following I2C commands are supported:\n\n```\n\tMOTOR_I2C_COMMAND_STOP\n\tMOTOR_I2C_COMMAND_HALT\n\tPID_I2C_COMMAND_ENABLE\n\tPID_I2C_COMMAND_DISABLE\n\tPID_I2C_COMMAND_RESET\n\tPID_I2C_COMMAND_SET_VALUE\n\tPID_I2C_COMMAND_SET_K_P\n\tPID_I2C_COMMAND_SET_K_I\n\tPID_I2C_COMMAND_SET_K_D\n\tPID_I2C_COMMAND_SET_DEAD_BAND\n```\n\nReading the measurement value:\n\n```\n\t// Read from Slave\n\tWire.requestFrom(target, (size_t)(sizeof i2cData.parameterValue));\n\n\tif (Wire.getError())\n\t{\n\t\tSerial.print(\"FAIL\\n\");\n\t}\n\telse\n\t{\n\t\t// If no error then read Rx data into buffer and print\n\t\tuint8_t len = io::i2cRead(i2cData.parameterValue, true);\n\t\t// Serial.printf(\"read bytes: %d, value: %d\\n\", len, i2cData.parameterValue);\n\t}\n```\n\nExample for sending a byte command:\n\n```\n\tWire.beginTransmission(0x4);\t\t  // Slave address\n\tio::i2cWrite(PID_I2C_COMMAND_ENABLE); // Write string to I2C Tx buffer (incl. string null at end)\n\tWire.endTransmission();\n\n\tif (Wire.getError())\n\t\t...\n```\n\nExample for sending a command with a parameter:\n\n```\n\ti2cData.parameterValue = 10;\n\tWire.beginTransmission(0x4);\t\t   // Slave address\n\tio::i2cWrite(PID_I2C_COMMAND_SET_K_P);\n\tio::i2cWrite(i2cData.parameterValue);\n\tWire.endTransmission();\n\n\tif (Wire.getError())\n\t\t...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelkrone%2Fattiny-pid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichaelkrone%2Fattiny-pid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichaelkrone%2Fattiny-pid/lists"}