public class SSD1306 extends Object
Example:
IODevice device = new FirmataDevice(port); // connecting to firmata device device.ensureInitializationIsDone(); // waiting for the device is ready I2CDevice i2cDevice = device.getI2CDevice((byte) 0x3C); // or 0x3D - standard address for SSD1306 SSD1306 display = new SSD1306(i2cDevice, SSD1306.Size.SSD1306_128_64); // constructing a display on top of i2c device reference display.init(); // initializing display display.getCanvas().drawString(3, 3, "firmata4j"); // drawing a string on display's canvas // drawing anything else display.display(); // displaying current state of display's canvas // doing anything else display.turnOff(); // switching off the display device.stop(); // stopping IODevice
https://www.adafruit.com/category/63_98
Modifier and Type | Class and Description |
---|---|
static class |
SSD1306.Size |
static class |
SSD1306.VCC |
Constructor and Description |
---|
SSD1306(I2CDevice device,
SSD1306.Size size) |
SSD1306(I2CDevice device,
SSD1306.Size size,
SSD1306.VCC vcc) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
void |
dim(boolean dim)
Dims the display
|
void |
display() |
MonochromeCanvas |
getCanvas() |
SSD1306.Size |
getSize() |
void |
init()
Prepares the device to operation.
|
void |
invertDisplay(boolean inverted) |
void |
scrollLeft() |
void |
scrollRight() |
void |
stopScrolling() |
void |
turnOff() |
void |
turnOn() |
public SSD1306(I2CDevice device, SSD1306.Size size)
public SSD1306(I2CDevice device, SSD1306.Size size, SSD1306.VCC vcc)
public void init()
public void turnOn()
public void turnOff()
public void scrollRight()
public void scrollLeft()
public void stopScrolling()
public void invertDisplay(boolean inverted)
public void clear()
public void dim(boolean dim)
dim
- true - display is dimmed, false - display is normalpublic void display()
public SSD1306.Size getSize()
public MonochromeCanvas getCanvas()
Copyright © 2017. All rights reserved.