{"id":18734000,"url":"https://github.com/kr4fty/encoderpci","last_synced_at":"2025-04-12T18:32:05.438Z","repository":{"id":88772493,"uuid":"92959334","full_name":"kr4fty/EncoderPCI","owner":"kr4fty","description":"A quadrature encoder library that can use hardware or pin-change interrupts by using the EnableInterrupt library.","archived":false,"fork":false,"pushed_at":"2022-09-28T09:52:26.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T13:21:20.271Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","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/kr4fty.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-31T15:13:55.000Z","updated_at":"2024-01-26T18:48:30.000Z","dependencies_parsed_at":"2023-06-12T13:15:14.446Z","dependency_job_id":null,"html_url":"https://github.com/kr4fty/EncoderPCI","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/kr4fty%2FEncoderPCI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kr4fty%2FEncoderPCI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kr4fty%2FEncoderPCI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kr4fty%2FEncoderPCI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kr4fty","download_url":"https://codeload.github.com/kr4fty/EncoderPCI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248613621,"owners_count":21133554,"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-11-07T15:12:03.151Z","updated_at":"2025-04-12T18:32:05.432Z","avatar_url":"https://github.com/kr4fty.png","language":"C++","readme":"# EncoderPCI\nA quadrature encoder library that can use hardware or pin-change interrupts by using the [EnableInterrupt](https://github.com/GreyGnome/EnableInterrupt) library.\u003cbr /\u003e\nBased on the [Encoder](https://github.com/PaulStoffregen/Encoder) library by PaulStoffregen\n\n## Usage:\nDefine Encoder objects using this :\n```cpp\nEncoder myEnc= Encoder(pinA, pinB);\n```\n\nRead encoder output\n```cpp\nint32_t encoderOutput = myEnc.read\n```\nReset encoder count to 0 (in home position):\n```cpp\nmyEnc.write(0)  \n```\nReset encoder count to a value\n```cpp\nmyEnc.write(value)\n```\n\n\n## PinchangeInterrupt Table\n\nPins with * are not broken out/deactivated by default.\nYou may activate them in the setting file (advanced).\n\nEach row section represents a port(0-3).\nNot all MCUs have all Ports/Pins physically available.\n\n**ATTENTION!**\u003cbr /\u003e\nIf you use the EnableInterrup library in your program to enable one or more interrupts, you should define *LIBCALL_ENABLEINTERRUPT* before #includes. This is to avoid compilation problems\u003cbr /\u003e\n\nFor more information read this [issue](https://github.com/GreyGnome/EnableInterrupt/issues/13#issuecomment-123439620)\n\n### Official Arduinos\n\n| PCINT |  Uno/Nano/Mini  |   Mega/2560    | Leonardo/Micro | HL2 (8/16/32u2) |\n| ----- | --------------- | -------------- | -------------- | --------------- |\n|     0 |  8       (PB0)  | 53 SS   (PB0)  |    SS   (PB0)* |  0 SS   (PB0)*  |\n|     1 |  9       (PB1)  | 52 SCK  (PB1)  |    SCK  (PB1)  |  1 SCK  (PB1)   |\n|     2 | 10 SS    (PB2)  | 51 MOSI (PB2)  |    MOSI (PB2)  |  2 MOSI (PB2)   |\n|     3 | 11 MISO  (PB3)  | 50 MISO (PB3)  |    MISO (PB3)  |  3 MISO (PB3)   |\n|     4 | 12 MOSI  (PB4)  | 10      (PB4)  |  8/A8   (PB4)  |  4      (PB4)   |\n|     5 | 13 SCK   (PB5)  | 11      (PB5)  |  9/A9   (PB5)  |  5      (PB5)   |\n|     6 |    XTAL1 (PB6)* | 12      (PB6)  | 10/A10  (PB6)  |  6      (PB6)   |\n|     7 |    XTAL2 (PB7)* | 13      (PB7)  | 11      (PB7)  |  7      (PB7)   |\n| ----- | --------------- | -------------- | -------------- | --------------- |\n|     8 | A0       (PC0)  |  0 RX   (PE0)* |                |         (PC6)*  |\n|     9 | A1       (PC1)  | 15 RX3  (PJ0)* |                |         (PC5)*  |\n|    10 | A2       (PC2)  | 14 TX3  (PJ1)* |                |         (PC4)*  |\n|    11 | A3       (PC3)  |    NC   (PJ2)* |                |         (PC2)*  |\n|    12 | A4 SDA   (PC4)  |    NC   (PJ3)* |                |         (PD5)*  |\n|    13 | A5 SDC   (PC5)  |    NC   (PJ4)* |                |                 |\n|    14 |    RST   (PC6)* |    NC   (PJ5)* |                |                 |\n|    15 |                 |    NC   (PJ6)* |                |                 |\n| ----- | --------------- | -------------- | -------------- | --------------- |\n|    16 |  0 RX    (PD0)  | A8      (PK0)  |                |                 |\n|    17 |  1 TX    (PD1)  | A9      (PK1)  |                |                 |\n|    18 |  2 INT0  (PD2)  | A10     (PK2)  |                |                 |\n|    19 |  3 INT1  (PD3)  | A11     (PK3)  |                |                 |\n|    20 |  4       (PD4)  | A12     (PK4)  |                |                 |\n|    21 |  5       (PD5)  | A13     (PK5)  |                |                 |\n|    22 |  6       (PD6)  | A14     (PK6)  |                |                 |\n|    23 |  7       (PD7)  | A15     (PK7)  |                |                 |\n| ----- | --------------- | -------------- | -------------- | --------------- |\n\n\n### Atmel Attinys\n\n| PCINT |   Attiny13   |    Attiny x4    |   Attiny x5   |     Attiny x41      |\n| ----- | ------------ | --------------- | ------------- | ------------------- |\n|     0 | 0 MOSI (PB0) |  0       (PA0)  | 0 MOSI  (PB0) | A0/D0         (PA0) |\n|     1 | 1 MISO (PB1) |  1       (PA1)  | 1 MISO  (PB1) | A1/D1         (PA1) |\n|     2 | 2 SCK  (PB2) |  2       (PA2)  | 2 SCK   (PB2) | A2/D2         (PA2) |\n|     3 | 3      (PB3) |  3       (PA3)  | 3 XTAL1 (PB3) | A3/D3         (PA3) |\n|     4 | 4      (PB4) |  4 SCK   (PA4)  | 4 XTAL2 (PB4) | A4/D4         (PA4) |\n|     5 | 5 RST  (PB5) |  5 MISO  (PA5)  | 5 RST   (PB5) | A5/D5   PWM   (PA5) |\n|     6 |              |  6 MOSI  (PA6)  |               | A7/D7   PWM   (PA6) |\n|     7 |              |  7       (PA7)  |               | A6/D6   PWM   (PA7) |\n| ----- | ------------ | --------------- | ------------- | ------------------- |\n|     8 |              | 10 XTAL1 (PB0)* |               | A10/D10 XTAL1 (PB0) |\n|     9 |              |  9 XTAL2 (PB1)* |               | A9/D9   XTAL2 (PB1) |\n|    10 |              |  8 INT0  (PB2)* |               | A8/D8   PWM   (PB2) |\n|    11 |              |    RST   (PB3)* |               |         RST   (PB3) |\n|    12 |              |                 |               |                     |\n|    13 |              |                 |               |                     |\n|    14 |              |                 |               |                     |\n|    15 |              |                 |               |                     |\n| ----- | ------------ | --------------- | ------------- | ------------------- |\n\n\n### Other Atmel MCUs\n\n| PCINT | ATmega644P/1284P  |\n| ----- | ----------------- |\n|     0 | A0/D24      (PA0) |\n|     1 | A1/D25      (PA1) |\n|     2 | A2/D26      (PA2) |\n|     3 | A3/D27      (PA3) |\n|     4 | A4/D28      (PA4) |\n|     5 | A5/D29      (PA5) |\n|     6 | A6/D30      (PA6) |\n|     7 | A7/D31      (PA7) |\n| ----- | ----------------- |\n|     8 |  0          (PB0) |\n|     9 |  1          (PB1) |\n|    10 |  2 INT2     (PB2) |\n|    11 |  3 PWM      (PB3) |\n|    12 |  4 SS/PWM   (PB4) |\n|    13 |  5 MOSI/PWM (PB5) |\n|    14 |  6 MISO/PWM (PB6) |\n|    15 |  7 SCK      (PB7) |\n| ----- | ----------------- |\n|    16 | 16 SCL      (PC0) |\n|    17 | 17 SDA      (PC1) |\n|    18 | 18 TCK      (PC2) |\n|    19 | 19 TMS      (PC3) |\n|    20 | 20 TDO      (PC4) |\n|    21 | 21 TDI      (PC5) |\n|    22 | 22          (PC6) |\n|    23 | 23          (PC7) |\n| ----- | ----------------- |\n|    24 |  8 RX0      (PD0) |\n|    25 |  9 TX0      (PD1) |\n|    26 | 10 RX1/INT0 (PD2) |\n|    27 | 11 TX1/INT1 (PD3) |\n|    28 | 12 PWM      (PD4) |\n|    29 | 13 PWM      (PD5) |\n|    30 | 14 PWM      (PD6) |\n|    31 | 15 PWM      (PD7) |\n| ----- | ----------------- |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkr4fty%2Fencoderpci","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkr4fty%2Fencoderpci","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkr4fty%2Fencoderpci/lists"}