Class BrickletOLED128x64


  • public class BrickletOLED128x64
    extends Device
    3.3cm (1.3") OLED display with 128x64 pixels
    • Constructor Detail

      • BrickletOLED128x64

        public BrickletOLED128x64​(java.lang.String uid,
                                  IPConnection ipcon)
        Creates an object with the unique device ID \c uid. and adds it to the IP Connection \c ipcon.
    • Method Detail

      • write

        public void write​(short[] data)
                   throws TinkerforgeException
        Appends 64 byte of data to the window as set by newWindow(short, short, short, short). Each row has a height of 8 pixels which corresponds to one byte of data. Example: if you call newWindow(short, short, short, short) with column from 0 to 127 and row from 0 to 7 (the whole display) each call of write(short[]) (red arrow) will write half of a row. .. image:: /Images/Bricklets/bricklet_oled_128x64_display.png :scale: 100 % :alt: Display pixel order :align: center :target: ../../_images/Bricklets/bricklet_oled_128x64_display.png The LSB (D0) of each data byte is at the top and the MSB (D7) is at the bottom of the row. The next call of write(short[]) will write the second half of the row and the next two the second row and so on. To fill the whole display you need to call write(short[]) 16 times.
        Throws:
        TinkerforgeException
      • setDisplayConfiguration

        public void setDisplayConfiguration​(short contrast,
                                            boolean invert)
                                     throws TinkerforgeException
        Sets the configuration of the display. You can set a contrast value from 0 to 255 and you can invert the color (black/white) of the display.
        Throws:
        TinkerforgeException
      • writeLine

        public void writeLine​(short line,
                              short position,
                              java.lang.String text)
                       throws TinkerforgeException
        Writes text to a specific line with a specific position. The text can have a maximum of 26 characters. For example: (1, 10, "Hello") will write *Hello* in the middle of the second line of the display. You can draw to the display with write(short[]) and then add text to it afterwards. The display uses a special 5x7 pixel charset. You can view the characters of the charset in Brick Viewer. The font conforms to code page 437.
        Throws:
        TinkerforgeException
      • getIdentity

        public Device.Identity getIdentity()
                                    throws TinkerforgeException
        Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier. The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an :ref:`Isolator Bricklet <isolator_bricklet>` is always at position 'z'. The device identifier numbers can be found :ref:`here <device_identifier>`. |device_identifier_constant|
        Specified by:
        getIdentity in class Device
        Throws:
        TinkerforgeException