{"id":14978040,"url":"https://github.com/d2r2/go-hd44780","last_synced_at":"2025-10-02T13:30:57.253Z","repository":{"id":34595189,"uuid":"38542775","full_name":"d2r2/go-hd44780","owner":"d2r2","description":"Golang library to interact with liquid-crystal display driven by Hitachi HD44780 IC via I2C-bus driver from Raspberry PI.","archived":false,"fork":true,"pushed_at":"2022-09-17T19:33:04.000Z","size":1929,"stargazers_count":33,"open_issues_count":2,"forks_count":12,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-09-24T23:31:58.957Z","etag":null,"topics":["embedded-linux","golang","gpio","i2c","i2c-display","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"davecheney/i2c","license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d2r2.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":"2015-07-04T17:58:07.000Z","updated_at":"2023-12-09T06:25:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/d2r2/go-hd44780","commit_stats":null,"previous_names":["d2r2/i2c"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-hd44780","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-hd44780/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-hd44780/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2r2%2Fgo-hd44780/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d2r2","download_url":"https://codeload.github.com/d2r2/go-hd44780/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219875700,"owners_count":16554702,"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":["embedded-linux","golang","gpio","i2c","i2c-display","raspberry-pi"],"created_at":"2024-09-24T13:56:45.746Z","updated_at":"2025-10-02T13:30:56.812Z","avatar_url":"https://github.com/d2r2.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Liquid-crystal display equiped with HD44780 integrated circuit\n==============================================================\n\n[![Build Status](https://travis-ci.org/d2r2/go-hd44780.svg?branch=master)](https://travis-ci.org/d2r2/go-hd44780)\n[![Go Report Card](https://goreportcard.com/badge/github.com/d2r2/go-hd44780)](https://goreportcard.com/report/github.com/d2r2/go-hd44780)\n[![GoDoc](https://godoc.org/github.com/d2r2/go-hd44780?status.svg)](https://godoc.org/github.com/d2r2/go-hd44780)\n[![MIT License](http://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)\n\u003c!--\n[![Coverage Status](https://coveralls.io/repos/d2r2/go-dht/badge.svg?branch=master)](https://coveralls.io/r/d2r2/go-dht?branch=master)\n--\u003e\n\nThis library written in [Go programming language](https://golang.org/) to control parameters of and output alpha-numeric characters to liquid-crystal display equiped with HD44780 integrated circuit ([pdf reference](https://raw.github.com/d2r2/go-hd44780/master/docs/HD44780.pdf)). This code intended to run from Raspberry PI to get control above liquid-crystal display via i2c bus controller (soldered to lcd-display on the back side).\n\nThere is some variety in display size, so library was tested with two kinds (width x height): 16x2 and 20x4 (pictures 1 and 2 correspond to 16x2 display, picture 3 - 20x4 display):\n\n![image](https://raw.github.com/d2r2/go-hd44780/master/docs/16x2_20x4_2.jpg)\n\nCompatibility\n-------------\n\nTested on Raspberry PI 1 (model B) and Banana PI (model M1).\n\nGolang usage\n------------\n\n```go\nfunc main() {\n  // Create new connection to i2c-bus on 2 line with address 0x27.\n  // Use i2cdetect utility to find device address over the i2c-bus\n  i2c, err := i2c.NewI2C(0x27, 2)\n  if err != nil { log.Fatal(err) }\n  // Free I2C connection on exit\n  defer i2c.Close()\n  // Construct lcd-device connected via I2C connection\n  lcd, err := device.NewLcd(i2c, device.LCD_16x2)\n  if err != nil { log.Fatal(err) }\n  // Turn on the backlight\n  err = lcd.BacklightOn()\n  if err != nil { log.Fatal(err) }\n  // Put text on 1 line of lcd-display\n  err = lcd.ShowMessage(\"--=! Let's rock !=--\", device.SHOW_LINE_1)\n  if err != nil { log.Fatal(err) }\n  // Wait 5 secs\n  time.Sleep(5 * time.Second)\n  // Output text to 2 line of lcd-screen\n  err = lcd.ShowMessage(\"Welcome to RPi dude!\", device.SHOW_LINE_2)\n  if err != nil { log.Fatal(err) }\n  // Wait 5 secs\n  time.Sleep(5 * time.Second)\n  // Turn off the backlight and exit\n  err = lcd.BacklightOff()\n  if err != nil { log.Fatal(err) }\n}\n```\n\nGetting help\n------------\n\nGoDoc [documentation](http://godoc.org/github.com/d2r2/go-hd44780)\n\nInstallation\n------------\n\n```bash\n$ go get -u github.com/d2r2/go-hd44780\n```\n\nTroubleshoting\n--------------\n\n- *How to obtain fresh Golang installation to RPi device (either any RPi clone):*\nIf your RaspberryPI golang installation taken by default from repository is outdated, you may consider\nto install actual golang mannualy from official Golang [site](https://golang.org/dl/). Download\ntar.gz file containing armv6l in the name. Follow installation instructions.\n\n- *How to enable I2C bus on RPi device:*\nIf you employ RaspberryPI, use raspi-config utility to activate i2c-bus on the OS level.\nGo to \"Interfaceing Options\" menu, to active I2C bus.\nProbably you will need to reboot to load i2c kernel module.\nFinally you should have device like /dev/i2c-1 present in the system.\n\n- *How to find I2C bus allocation and device address:*\nUse i2cdetect utility in format \"i2cdetect -y X\", where X may vary from 0 to 5 or more,\nto discover address occupied by peripheral device. To install utility you should run\n`apt install i2c-tools` on debian-kind system. `i2cdetect -y 1` sample output:\n\t```\n\t     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f\n\t00:          -- -- -- -- -- -- -- -- -- -- -- -- --\n\t10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\t20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\t30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\t40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\t50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\t60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --\n\t70: -- -- -- -- -- -- 76 --    \n\t```\n\n\u003e NOTE 1: Library is not goroutine-safe, so use synchronization approach when multi-gorutine output expected to display in application.\n\n\u003e NOTE 2: If you experience issue with lcd-device stability play with strobe delays in routine `writeDataWithStrobe(data byte)`. Default settings: 200 ms (microseconds) for setting stober, and 30 ms for exposing it to zero. Try to increase them a little bit, if you expirience any malfunction.\n\nCredits\n-------\n\nThis is a fork from completely similar functionality (https://github.com/davecheney/i2c), but due to the some uncertain issues does not work for me. So, it was rewritten with additional code modification.\n\nContact\n-------\n\nPlease use [Github issue tracker](https://github.com/d2r2/go-hd44780/issues) for filing bugs or feature requests.\n\nLicense\n-------\n\nGo-hd44780 is licensed inder MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd2r2%2Fgo-hd44780","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd2r2%2Fgo-hd44780","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd2r2%2Fgo-hd44780/lists"}