Skip to content

pappersverk/scenic_driver_oled

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OLED Scenic Driver

This library provides a Scenic driver implementation for OLED thanks to rpi_fb_capture.

Setup

1. Add the dependencies

def deps do
  [
    {:scenic_driver_oled, "~> 0.1.0"}
  ]
end

2. Configure the driver

Passing the configuration for the display...

config :my_app, :viewport, %{
  name: :main_viewport,
  default_scene: {MyApp.Scene.Default, nil},
  size: {128, 64},
  opts: [scale: 1.0],
  drivers: [
    %{
      module: OLED.Scenic.Driver,
      opts: [
        display: [
          driver: :ssd1306,
          type: :i2c,
          device: "i2c-1",
          address: 60,
          width: 128,
          height: 32
        ],
        dithering: :sierra
      ]
    }
  ]
}

... or the display module if you have one (Check the Basic Setup on OLED):

config :my_app, :viewport, %{
  name: :main_viewport,
  default_scene: {MyApp.Scene.Default, nil},
  size: {128, 64},
  opts: [scale: 1.0],
  drivers: [
    %{
      module: OLED.Scenic.Driver,
      opts: [
        display: MyApp.MyDisplay,
        dithering: :sierra
      ]
    }
  ]
}

Thanks

Special thanks to @nerves-training where I've seen for the first time approach of use rp_fb_capture in scenic_driver_oled_bonnet to implement a Scenic driver.

About

Scenic driver for the OLED library

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages