Package com.diozero.devices.oled
Class SSD1331
java.lang.Object
com.diozero.devices.oled.SsdOled
com.diozero.devices.oled.ColourSsdOled
com.diozero.devices.oled.SSD1331
- All Implemented Interfaces:
DeviceInterface
,AutoCloseable
public class SSD1331 extends ColourSsdOled
Encapsulates the serial interface to the 16-bit colour (5-6-5 RGB) SSD1331 96x64 OLED display hardware. On creation, an initialisation sequence is pumped to the display to properly configure it. Further control commands can then be called to affect the brightness and other settings.
Wiring:
GND .... Ground Vcc .... 3v3 SCL .... SCLK (SPI) SDA .... MOSI (SPI) RES .... Reset (GPIO) [27] DC .... Data/Command Select (GPIO) [22] CS .... Chip Select (SPI)
Links
-
Field Summary
Fields inherited from class com.diozero.devices.oled.ColourSsdOled
MAX_BLUE, MAX_GREEN, MAX_RED
-
Constructor Summary
Constructors Constructor Description SSD1331(int controller, int chipSelect, DigitalOutputDevice dcPin, DigitalOutputDevice resetPin)
-
Method Summary
Modifier and Type Method Description protected void
goTo(int x, int y)
protected void
init()
void
invertDisplay(boolean invert)
Sets if the display should be invertedvoid
setContrast(byte level)
Switches the display contrast to the desired level, in the range 0-255.void
setContrast(byte red, byte green, byte blue)
Methods inherited from class com.diozero.devices.oled.ColourSsdOled
display, home, setPixel
-
Constructor Details
-
SSD1331
public SSD1331(int controller, int chipSelect, DigitalOutputDevice dcPin, DigitalOutputDevice resetPin)
-
-
Method Details
-
init
protected void init() -
goTo
protected void goTo(int x, int y) -
invertDisplay
public void invertDisplay(boolean invert)Sets if the display should be inverted- Specified by:
invertDisplay
in classSsdOled
- Parameters:
invert
- Invert state
-
setContrast
public void setContrast(byte level)Switches the display contrast to the desired level, in the range 0-255. Note that setting the level to a low (or zero) value will not necessarily dim the display to nearly off. In other words, this method is **NOT** suitable for fade-in/out animation.- Specified by:
setContrast
in classColourSsdOled
- Parameters:
level
- Desired contrast level in the range 0..255
-
setContrast
public void setContrast(byte red, byte green, byte blue)- Specified by:
setContrast
in classColourSsdOled
-