Provides a driver for SSD1306-based monochrome displays connected via I2C.
Go to file
Renovate Bot ebd53737f3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
chore(deps): update dependency earmark to v1.4.47
2024-07-13 06:39:22 +12:00
config chore: migrate to local. 2024-06-24 11:45:58 +12:00
lib chore: migrate to local. 2024-06-24 11:45:58 +12:00
test chore: set up git_ops and auto-releasing 2020-12-28 19:58:16 +13:00
.drone.yml chore: fix docs release job. 2024-06-24 12:03:54 +12:00
.formatter.exs Empty Elixir app 2019-10-04 16:43:03 +13:00
.gitignore Basic SSD1306 Driver working. 2019-10-04 23:19:32 +13:00
.tool-versions chore(deps): update dependency erlang to v27.0.1 2024-07-11 01:40:04 +12:00
CHANGELOG.md chore: release version v1.0.1 2024-06-24 12:00:03 +12:00
LICENSE.md chore!: Relicense to HL3-FULL. 2023-01-17 10:50:43 +13:00
mix.exs chore: release version v1.0.1 2024-06-24 12:00:03 +12:00
mix.lock chore(deps): update dependency earmark to v1.4.47 2024-07-13 06:39:22 +12:00
README.md chore: release version v1.0.1 2024-06-24 12:00:03 +12:00
renovate.json chore: Configure Renovate (#21) 2024-06-24 12:39:34 +12:00

SSD1306

Build Status Hex.pm Hippocratic License HL3-FULL

SSD1306 is an Elixir driver for SSD1306 devices like the Adafruit Monochrome 1.3" OLED display connected via I2C. It should be possible to modify this library to use the SPI interface also, because all the commands are the same, but I'm only using them via I2C. Patches welcome.

We make use of Elixir ALE, so all the caveats about installing that also apply here.

Usage

Add your devices to your config like so:

use Config

config :ssd1306,
  devices: [
    %{bus: "i2c-1", address: 0x3d, reset_pin: 17}
  ]

And start your application. Your devices will be reset, initialised with defaults and a blank buffer will be sent to them. Note that this library assumes that you have the reset pin of the device connected to a GPIO pin on the local device.

Sending images

You need to generate buffers (Erlang binaries) of width _ height _ 8 bytes long. We do validate that the buffer is of the correct size, but there's no way to validate that it is of the correct geometry.

How you generate buffers is up to you, but I suggest Vivid.

Installation

If available in Hex, the package can be installed by adding ssd1306 to your list of dependencies in mix.exs:

def deps do
  [
    {:ssd1306, "~> 1.0.1"}
  ]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/SSD1306.

Github Mirror

This repository is mirrored on Github from it's primary location on my Forejo instance. Feel free to raise issues and open PRs on Github.

License

This software is licensed under the terms of the HL3-FULL, see the LICENSE.md file included with this package for the terms.

This license actively proscribes this software being used by and for some industries, countries and activities. If your usage of this software doesn't comply with the terms of this license, then contact me with the details of your use-case to organise the purchase of a license - the cost of which may include a donation to a suitable charity or NGO.