{"id":19155585,"url":"https://github.com/raspberrypi-go-drivers/l293d","last_synced_at":"2026-05-08T14:46:07.200Z","repository":{"id":39645108,"uuid":"322707210","full_name":"raspberrypi-go-drivers/l293d","owner":"raspberrypi-go-drivers","description":"Allows to use a L293D chip and control 2 (or 1)  associated DC motors","archived":false,"fork":false,"pushed_at":"2020-12-26T14:28:30.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-28T00:06:07.424Z","etag":null,"topics":["go","golang","l293d","l298n","raspberry-pi","raspberrypi-drivers","robotics"],"latest_commit_sha":null,"homepage":"","language":"Go","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/raspberrypi-go-drivers.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":"2020-12-18T21:21:28.000Z","updated_at":"2021-10-06T04:13:35.000Z","dependencies_parsed_at":"2022-09-06T02:30:57.897Z","dependency_job_id":null,"html_url":"https://github.com/raspberrypi-go-drivers/l293d","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/raspberrypi-go-drivers/l293d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi-go-drivers%2Fl293d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi-go-drivers%2Fl293d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi-go-drivers%2Fl293d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi-go-drivers%2Fl293d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raspberrypi-go-drivers","download_url":"https://codeload.github.com/raspberrypi-go-drivers/l293d/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raspberrypi-go-drivers%2Fl293d/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32785391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"ssl_error","status_checked_at":"2026-05-08T08:22:45.650Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["go","golang","l293d","l298n","raspberry-pi","raspberrypi-drivers","robotics"],"created_at":"2024-11-09T08:31:17.864Z","updated_at":"2026-05-08T14:46:07.068Z","avatar_url":"https://github.com/raspberrypi-go-drivers.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# L293D\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/raspberrypi-go-drivers/l293d.svg)](https://pkg.go.dev/github.com/raspberrypi-go-drivers/l293d)\n![golangci-lint](https://github.com/raspberrypi-go-drivers/l293d/workflows/golangci-lint/badge.svg)\n[![Go Report Card](https://goreportcard.com/badge/github.com/raspberrypi-go-drivers/l293d)](https://goreportcard.com/report/github.com/raspberrypi-go-drivers/l293d)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nThe L293D chip allows to control 2 DC motors using 2 PWM pins and 4 other pins\n\n## Documentation\n\nFor full documentation, please visit [![Go Reference](https://pkg.go.dev/badge/github.com/raspberrypi-go-drivers/l293d.svg)](https://pkg.go.dev/github.com/raspberrypi-go-drivers/l293d)\n\n## Quick start\n\n```go\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"time\"\n\n\t\"github.com/raspberrypi-go-drivers/l293d\"\n\t\"github.com/stianeikeland/go-rpio/v4\"\n)\n\nfunc main() {\n\terr := rpio.Open()\n\tif err != nil {\n\t\tos.Exit(1)\n\t}\n\tdefer rpio.Close()\n\tchip := l293d.NewL293D()\n\tpinEnableA := uint8(12) // PWM compatible\n\tpin1a := uint8(17)\n\tpin2a := uint8(27)\n\n\tpinEnableB := uint8(13) // PWM compatible\n\tpin1b := uint8(23)\n\tpin2b := uint8(24)\n\tmotor1, err := chip.NewMotor(1, pinEnableA, pin1a, pin2a)\n\tif err != nil {\n\t\tfmt.Println(\"impossible to create new motor\")\n\t}\n\tmotor2, err := chip.NewMotor(2, pinEnableB, pin1b, pin2b)\n\tif err != nil {\n\t\tfmt.Println(\"impossible to create new motor\")\n\t}\n\t// Looks like motors are not running correctly below some speed percentage\n\t// I experienced it below 50%\n\t// Set motor1 speed to 65%\n\tmotor1.SetSpeed(65)\n\t// Set motor2 speed to 80%\n\tmotor2.SetSpeed(80)\n\ttime.Sleep(3 * time.Second)\n\tmotor1.SetSpeed(0)\n\tmotor2.SetSpeed(0)\n}\n```\n\n## Datasheet\n\nL293D datasheet: https://www.ti.com/lit/ds/symlink/l293.pdf\n\n## First glance at L293D\n\n```\n           ______________\n  1,2EN --|              |-- Vcc1\n          |              |\n     1A --|              |-- 4A\n          |              |\n     1Y --|              |-- 4Y\n          |              |\n    GND --|              |-- GND\n          |              |\n    GND --|              |-- GND\n          |              |\n     2Y --|              |-- 3Y\n          |              |\n     2A --|              |-- 3A\n          |              |\n   Vcc2 --|______________|-- 3,4EN\n```\n\n  Pins    | Description\n  --------|---------------------\n  1,2EN   | Enable inputs 1 \u0026 2\n  1A      | Input 1 for motor 1\n  2A      | Input 2 for motor 1\n  1Y \u0026 2Y | To motor 1\n  Vcc2    | 5V to 36V input for motors\n  3,4EN   | Enable inputs 3 \u0026 4\n  3A      | Input 1 for motor 2\n  4A      | Input 2 for motor 2\n  3Y \u0026 4Y | To motor 2\n  Vcc1    | 5V input for chip (can be taken from Raspberry Pi)\n\n\n  Action (identical for 3,4)   | 1,2EN  | 1A   | 2A    | Comments\n  -----------------------------|--------|------|-------|---------------------------------\n  Rotation                     | high   | high | low   |\n  Reverse rotation             | high   | low  | high  |\n  Rotation speed               | PWM    | -    | -     |\n  Quick stop                   | low    | -    | -     | 1A and 2A state doesn't matter\n  Free rotation                | high   | low  | low   | or high/high\n\n\nTo control speed, a PWM signal have to be sent to pins 1,2EN for motor 1 and 3,4EN for motor 2\n\n## Raspberry Pi compatibility\n\nThis driver has has only been tested on an Raspberry Pi Zero WH using integrated bluetooth but may work well on other Raspberry Pi having integrated Bluetooth\n\n## License\n\nMIT License\n\n---\n\nSpecial thanks to @stianeikeland\n\nThis driver is based on his work in [stianeikeland/go-rpio](https://github.com/stianeikeland/go-rpio/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspberrypi-go-drivers%2Fl293d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraspberrypi-go-drivers%2Fl293d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraspberrypi-go-drivers%2Fl293d/lists"}