Class BrickletOLED64x48


  • public class BrickletOLED64x48
    extends Device
    1.68cm (0.66") OLED display with 64x48 pixels
    • Constructor Detail

      • BrickletOLED64x48

        public BrickletOLED64x48​(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 63 and row from 0 to 5 (the whole display) each call of write(short[]) (red arrow) will write one row. .. image:: /Images/Bricklets/bricklet_oled_64x48_display.png :scale: 100 % :alt: Display pixel order :align: center :target: ../../_images/Bricklets/bricklet_oled_64x48_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 row and so on. To fill the whole display you need to call write(short[]) 6 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 13 characters. For example: (1, 4, "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