scenic_driver_oled v0.1.0 OLED.Scenic.Driver View Source
Requirements
The Scenic driver requires rpi_fb_capture
and scenic_driver_nerves_rpi
to work:
{:scenic_driver_nerves_rpi, "~> 0.10", targets: @all_targets},
{:rpi_fb_capture, "~> 0.3.0"}
Configuration
The driver can be configured in two ways:
Passing the entire 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
]
}
]
}
Passing the display module:
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
]
}
]
}
Dithering
OLED takes avatage of the rpi_db_capture
dithering feature to improve the visualization.
The current modes supported for the dithering
key are:
:none
- No dithering applied:floyd_steinberg
- Floyd–Steinberg:sierra
- Sierra (also called Sierra-3):sierra_2row
- Two-row Sierra:sierra_lite
- Sierra Lite
Link to this section Summary
Functions
Callback implementation for Scenic.ViewPort.Driver.handle_call/3
.
Callback implementation for Scenic.ViewPort.Driver.handle_cast/2
.
Link to this section Functions
Callback implementation for Scenic.ViewPort.Driver.handle_call/3
.
Callback implementation for Scenic.ViewPort.Driver.handle_cast/2
.