Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kixunil/seven_segment
A simple Rust driver for 7-segment displays
https://github.com/kixunil/seven_segment
Last synced: 3 months ago
JSON representation
A simple Rust driver for 7-segment displays
- Host: GitHub
- URL: https://github.com/kixunil/seven_segment
- Owner: Kixunil
- Created: 2018-12-08T15:11:32.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-03-10T10:12:09.000Z (almost 5 years ago)
- Last Synced: 2024-03-15T10:22:38.155Z (10 months ago)
- Language: Rust
- Size: 7.81 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Seven segment
=============Simple Rust driver for 7-segment displays
About
-----This is a driver (encoder) for 7-segment displays. It's implemented on top of embedded-hal, so you can use it on any platform that has pins with `embedded_hal::OutputPin` implemented.
The driver is very simple, only supports displays that connect directly using seven pins such as [SA52-11EWA](http://www.kingbrightusa.com/images/catalog/SPEC/SA52-11EWA.pdf) and doesn't try to do anything clever like setting all pins at once. It supports both common anode and common cathode displays.
Notes for upgrading from 0.1 to 0.2
-----------------------------------While the change in `0.2` is strictly speaking Semver-breaking, the changes you
need to do should be trivial. The breaking difference is use of embedded HAL v2
API with fallible PIN operations. As a result, `set` method now returns
`Result<(), Error>` instead of `()`.If you feed it pins implementing the old API, it still works thanks to the
blanket impl and the resulting `Error` will be uninhabited, so you can use
`.unwrap_or_else(|e| match e {})` to correctly avoid the unused result warning.However, in order to use the full power of the new version, you should handle
the errors properly, e.g. using the `?` operator. The implementation requires
that `Error` types of all output pins are the same. If this is limiting to you,
you can use a wrapper for the pins to convert the errors into a single type.
(e.g. an enum)License
-------
MITNFA