{"id":21223896,"url":"https://github.com/niklauslee/stepper","last_synced_at":"2025-09-15T07:32:43.445Z","repository":{"id":77037317,"uuid":"460375597","full_name":"niklauslee/stepper","owner":"niklauslee","description":"Kaluma library to control stepper motors","archived":false,"fork":false,"pushed_at":"2022-02-17T11:05:53.000Z","size":106,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-03T06:37:13.697Z","etag":null,"topics":["kaluma","motor","stepper"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/niklauslee.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":"2022-02-17T09:56:41.000Z","updated_at":"2025-02-10T02:34:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"b1615bc5-054a-4f8f-8fa5-30905d86f3ce","html_url":"https://github.com/niklauslee/stepper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/niklauslee/stepper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fstepper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fstepper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fstepper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fstepper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklauslee","download_url":"https://codeload.github.com/niklauslee/stepper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Fstepper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275225288,"owners_count":25427000,"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-09-15T02:00:09.272Z","response_time":75,"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":["kaluma","motor","stepper"],"created_at":"2024-11-20T22:54:00.436Z","updated_at":"2025-09-15T07:32:43.421Z","avatar_url":"https://github.com/niklauslee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stepper\n\nKaluma library to control unipolar or bipolar stepper motors.\n\n# Wiring\n\nHere is a wiring example with 28BYJ-48 stepper motor and ULN2003A driver.\n\n| Raspberry Pi Pico | ULN2003A (28BYJ-48) |\n| ----------------- | ------------------- |\n| VBUS              | +                   |\n| GND               | -                   |\n| GP10              | IN1                 |\n| GP11              | IN2                 |\n| GP12              | IN3                 |\n| GP13              | IN4                 |\n\n![wiring](https://github.com/niklauslee/stepper/blob/main/images/wiring.png?raw=true)\n\n# Install\n\n```sh\nnpm install https://github.com/niklauslee/stepper\n```\n\n# Usage\n\nHere is an example:\n\n```js\n// 2048 steps for a revolution\nconst steps = 2048;\n\n// pins for control wires\nconst pins = [10, 11, 12, 13];\n\n// The sequence of controls signals for 28BYJ-48\nconst signals = [0b1000, 0b0100, 0b0010, 0b0001];\n\nconst {Stepper} = require('stepper');\nconst stepper = new Stepper(steps, pins, signals);\n\nglobal.stepper = stepper;\nstepper.setSpeed(12); // 12 rpm\nstepper.step(2048);   // turn 360 degree in clockwise\ndelay(1000);          // wait 1 sec\nstepper.step(-2048);  // turn 360 degree in anti-clockwise\n```\n\n# API\n\n## Class: Stepper\n\n### new Stepper(steps, pins[, signals])\n\n- **`steps`** `\u003cnumber\u003e` Number of steps for a revolution.\n- **`pins`** `Array\u003cnumber\u003e` Pins wired to the stepper motor.\n- **`signals`** `Array\u003cnumber\u003e` The sequence of control signals. Optional.\n\nCreate an instance of Stepper class.\n\nThe `steps` parameter is the number of steps for a revolution.\n\nYou can provide control signals according to your stepper motor specification. Otherwise a default sequence of control signals are used for 2 pins and 4 pins. The default sequence of control signals are the same with Arduino's Stepper library.\n\n__Default control signals for 4 control wires__\n\n| Step | C0 | C1 | C2 | C4 |\n| ---- | -- | -- | -- | -- |\n| 1    | 1  | 0  | 1  | 0  |\n| 2    | 0  | 1  | 1  | 0  |\n| 3    | 0  | 1  | 0  | 1  |\n| 4    | 1  | 0  | 0  | 1  |\n\n__Default control signals for 2 control wires__\n\n| Step | C0 | C1 |\n| ---- | -- | -- |\n| 1    | 0  | 1  |\n| 2    | 1  | 1  |\n| 3    | 1  | 0  |\n| 4    | 0  | 0  |\n\n### setSpeed(rpm)\n\n- **`rpm`** `\u003cnumber\u003e` Default: `10`.\n\nSets the speed in revolutions per minute. This should be given less than the maximum speed of the stepper motor.\n\n### step(count)\n\n- **`count`** `\u003cnumber\u003e` Number of steps to move in clockwise. If a negative number is given, move in anti-clockwise.\n\nMove as the given number of steps.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklauslee%2Fstepper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklauslee%2Fstepper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklauslee%2Fstepper/lists"}