{"id":24642403,"url":"https://github.com/snakeye/ht1621","last_synced_at":"2026-04-13T21:31:41.256Z","repository":{"id":274147062,"uuid":"922044154","full_name":"snakeye/ht1621","owner":"snakeye","description":"A library to control HT1621-based 7-segment displays using Arduino/PlatformIO.","archived":false,"fork":false,"pushed_at":"2025-01-25T10:53:30.000Z","size":335,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-24T11:46:14.265Z","etag":null,"topics":["7-segment","arduino","display","ht1621","lcd","platformio"],"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/snakeye.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-01-25T06:52:28.000Z","updated_at":"2025-08-07T06:42:52.000Z","dependencies_parsed_at":"2025-10-14T22:44:14.699Z","dependency_job_id":null,"html_url":"https://github.com/snakeye/ht1621","commit_stats":null,"previous_names":["snakeye/ht1621"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/snakeye/ht1621","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snakeye%2Fht1621","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snakeye%2Fht1621/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snakeye%2Fht1621/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snakeye%2Fht1621/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snakeye","download_url":"https://codeload.github.com/snakeye/ht1621/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snakeye%2Fht1621/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31771809,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["7-segment","arduino","display","ht1621","lcd","platformio"],"created_at":"2025-01-25T13:11:34.722Z","updated_at":"2026-04-13T21:31:41.234Z","avatar_url":"https://github.com/snakeye.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HT1621Display Library\n\nThe HT1621Display library is a robust and flexible solution for controlling 7-segment displays based on the HT1621 driver IC. Designed with versatility and simplicity in mind, the library simplifies interfacing with various HT1621-based LCDs, allowing developers to focus on their applications instead of managing low-level details. Its modular and template-based architecture provides a unified approach for handling different display configurations, enabling both quick prototyping and advanced customization.\n\n![widely available HT1621 module connected to a 6-digit LCD display](images/lcd1.jpeg)\n\n![a clock built with a different type of LCD display](images/lcd2.jpeg)\n\n## Usage\n\n1. **Include the Library**  \n   Start by including the `HT1621Display.h` header file in your code.  \n   ```cpp\n   #include \u003cHT1621Display.h\u003e\n   ```\n\n2. **Define the Driver Class with Pin Definitions**  \n   Specify the pins for `CS`, `WR`, and `DATA`, then define a driver class template.  \n   ```cpp\n   #define PIN_CS 4\n   #define PIN_WR 5\n   #define PIN_DATA 6\n\n   typedef HT1621::Driver\u003cPIN_CS, PIN_WR, PIN_DATA\u003e DisplayDriver;\n   ```\n\n3. **Define the Display Class Using the Driver**  \n   Create a display class using the driver class defined earlier.  \n   ```cpp\n   typedef LCD::Display\u003cDisplayDriver\u003e Display;\n   ```\n\n4. **Instantiate the Display Object**  \n   Instantiate an object of the display class.  \n   ```cpp\n   Display htDisplay;\n   ```\n\n5. **Initialize the Display in the `setup` Function**  \n   Use the `begin()` and `configure()` methods to initialize the display.  \n   ```cpp\n   void setup() {\n       htDisplay.begin();\n       htDisplay.configure();\n   }\n   ```\n\n6. **Control the Display in the `loop` Function**  \n   Use methods like `clearBuffer()`, `setDigit()`, and `sync()` to display values.  \n   ```cpp\n   void loop() {\n       htDisplay.clearBuffer();\n       htDisplay.setDigit(0, 1);  // Display \"1\" at the first digit\n       htDisplay.sync();\n   }\n   ```\n\n## Configuration\n\nThe configuration of this library is divided into three distinct parts to ensure flexibility and modularity. \n\nFirst, the HT1621 chip configuration defines the pins used for communication with the chip, such as Chip Select (CS), Write (WR), and Data (DATA). This allows you to easily map the pins to your microcontroller's GPIOs. \n\nSecond, the LCD display configuration involves specifying the number of common pins, the segments of the display, and the corresponding bit masks that control the individual segments. These settings are essential for tailoring the display behavior to your specific hardware, whether it’s a 7-segment display or a more complex LCD. \n\nLastly, the character mapper converts input data (such as digits or custom characters) into the corresponding segment images to be displayed on the screen. This part of the configuration is responsible for mapping characters or digits to their visual representations, ensuring that the display outputs the correct content. \n\nTogether, these three configuration layers provide a flexible and easy-to-adapt structure for controlling a wide variety of HT1621-based displays.\n\n### DefaultHardwareConfig\n\nThe `DefaultHardwareConfig` struct provides default configuration settings for the display hardware. You can override it in your code to work with different kinds of LCD displays.\n\n* commons: The number of common pins (typically 2, 3, or 4).\n* digits: The number of digits on the display.\n* bias: The bias configuration (either 1/2 or 1/3 bias).\n* SEG_*: Segment definitions for controlling individual segments of the display.\n\n### CharacterMapper\n\nThe `CharacterMapper` class provides functions for mapping digits and characters to their corresponding segment data. You can extend this to support additional custom characters if needed.\n\n## License\n\nThis library is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnakeye%2Fht1621","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnakeye%2Fht1621","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnakeye%2Fht1621/lists"}