{"id":21223888,"url":"https://github.com/niklauslee/tm1637","last_synced_at":"2025-03-15T01:33:33.296Z","repository":{"id":77037332,"uuid":"460274981","full_name":"niklauslee/tm1637","owner":"niklauslee","description":"Kaluma library for 7-segment LED Display","archived":false,"fork":false,"pushed_at":"2022-02-17T04:56:45.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T17:30:36.903Z","etag":null,"topics":["7-segment","display","kaluma","led"],"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-17T04:00:34.000Z","updated_at":"2024-02-10T16:35:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"f6891970-3e2b-4e1d-8cc3-edcbf66c3bc6","html_url":"https://github.com/niklauslee/tm1637","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Ftm1637","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Ftm1637/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Ftm1637/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niklauslee%2Ftm1637/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niklauslee","download_url":"https://codeload.github.com/niklauslee/tm1637/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243671778,"owners_count":20328692,"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":["7-segment","display","kaluma","led"],"created_at":"2024-11-20T22:53:59.784Z","updated_at":"2025-03-15T01:33:33.288Z","avatar_url":"https://github.com/niklauslee.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TM1637 (7-segment display)\n\nKaluma library for 7-segment LED Display\n\n# Wiring\n\nHere is a wiring example.\n\n| Raspberry Pi Pico | TM1637 | \n| ----------------- | ------ |\n| 3V3               | VCC    |\n| GND               | GND    |\n| GP0               | CLK    |\n| GP1               | DIO    |\n\n![wiring](https://github.com/niklauslee/tm1637/blob/main/images/wiring.jpg?raw=true)\n\n# Install\n\n```sh\nnpm install https://github.com/niklauslee/tm1637\n```\n\n# Usage\n\n```javascript\nconst {TM1637} = require('tm1637');\nconst tm1637 = new TM1637(0, 1); // CLK=0, DIO=1\n\n// Show \"03:15\"\ntm1637.setDigit(0, TM1637.DIGIT[0]); // 0\ntm1637.setDigit(1, TM1637.DIGIT[3] | TM1637.SEG_X); // 3:\ntm1637.setDigit(2, TM1637.DIGIT[1]); // 1\ntm1637.setDigit(3, TM1637.DIGIT[5]); // 5\ndelay(1000);\n\n// Change brightness (0 ~ 7)\nfor (i = 0; i \u003c= 7; i++) {\n  tm1637.setBrightness(i);\n  delay(500);\n}\ndelay(1000);\n\n// Display on and off (blinking)\nfor (i = 0; i \u003c 10; i++) {\n  tm1637.off();\n  delay(100);\n  tm1637.on();\n  delay(100);\n}\ndelay(1000);\n\n// Show number from 0 to 500\nfor (i = 0; i \u003c= 500; i++) {\n  tm1637.display(i);\n}\ndelay(1000);\n\n// Show \"done\"\ntm1637.setDigit(0, TM1637.SEG_B | TM1637.SEG_C | TM1637.SEG_D | TM1637.SEG_E | TM1637.SEG_G); // d\ntm1637.setDigit(1, TM1637.SEG_C | TM1637.SEG_D | TM1637.SEG_E | TM1637.SEG_G); // o\ntm1637.setDigit(2, TM1637.SEG_C | TM1637.SEG_E | TM1637.SEG_G); // n\ntm1637.setDigit(3, TM1637.SEG_A | TM1637.SEG_B | TM1637.SEG_D | TM1637.SEG_E | TM1637.SEG_F | TM1637.SEG_G); // e\n```\n\n# API\n \n## Class: TM1637\n \nA class encapulating TM1637 driver.\n \n### new TM1637(clkPin, dioPin[, length[, brightness]])\n \nCreate an instance of TM1637 class.\n\n- **`clkPin`** `\u003cnumber\u003e` Pin number for CLK.\n- **`dioPin`** `\u003cnumber\u003e` Pin number for DIO.\n- **`length`** `\u003cnumber\u003e` Number of digits. Default: `4`.\n- **`brightness`** `\u003cnumber\u003e` Level of brightness (0~7). Default: `7`.\n\n### tm1637.clear()\n\nClear all digits.\n\n### tm1637.on()\n\nTurn on the display.\n\n### tm1637.off()\n\nTurn off the display.\n\n### tm1637.setBrightness(brightness)\n\nSet the brightness of the display.\n\n- **`brightness`** `\u003cnumber\u003e` Level of brightness (0~7).\n\n### tm1637.setDigit(pos, data)\n\nSet a digit with the data.\n\n- **`pos`** `\u003cnumber\u003e` Position to set digit data.\n- **`data`** `\u003cnumber\u003e` 7-segment data for the digit.\n\n```\n  7-SEGMENT\n\n      A\n     ---\n  F |   | B\n     -G-\n  E |   | C\n     ---  . X\n      D\n```\n\n### tm1637.display(value)\n\nShow the number value on the display.\n\n- **`value`** `\u003cnumber\u003e` A number to display.\n\n### TM1637.SEG_A\n\nBit for the segment A. (`0x01`)\n\n- `\u003cnumber\u003e`\n\n### TM1637.SEG_B\n\nBit for the segment B. (`0x02`)\n\n- `\u003cnumber\u003e`\n\n### TM1637.SEG_C\n\nBit for the segment C. (`0x04`)\n\n- `\u003cnumber\u003e`\n\n### TM1637.SEG_D\n\nBit for the segment D. (`0x08`)\n\n- `\u003cnumber\u003e`\n\n\n### TM1637.SEG_E\n\nBit for the segment E. (`0x10`)\n\n- `\u003cnumber\u003e`\n\n### TM1637.SEG_F\n\nBit for the segment F. (`0x20`)\n\n- `\u003cnumber\u003e`\n\n### TM1637.SEG_G\n\nBit for the segment G. (`0x40`)\n\n- `\u003cnumber\u003e`\n\n### TM1637.SEG_X\n\nBit for the segment X (Dot or Colon). (`0x80`)\n\n- `\u003cnumber\u003e`\n\n### TM1637.DIGIT\n\nAn array of 7-segment data for number digits from 0 to 9.\n\n- `Array\u003cnumber\u003e`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklauslee%2Ftm1637","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklauslee%2Ftm1637","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklauslee%2Ftm1637/lists"}