TCP/IP - Segment Display 4x7 Bricklet – Tinkerforge

- Getting Started
  - Primer
  - Tutorials
  - FAQ
- Hardware
  - Bricks
  - Bricklets
  - Master Extensions
  - Power Supplies
  - Accessories
  - Timeline
- Software
  - Brick Daemon (brickd)
  - Brick Viewer (brickv)
  - API Bindings
  - Firmwares and Plugins
  - Device Identifier
  - Source Code and Bug Tracking
  - Programming Interface
- Starter Kits
  - Weather Station
  - Hardware Hacking
  - Server Room Monitoring
  - Blinkenlights
  - Internet of Things
  - Camera Slider
- Embedded Boards
  - Raspberry Pi
- Specifications
  - Technical Data
  - TCP/IP Protocol
    - Protocol
    - API
      - Brick Daemon Functions
      - Broadcast Functions
      - General Callbacks
      - Bricks and Bricklets
        - Bricks
        - Bricklets
          - Ambient Light Bricklet
          - Analog In Bricklet
          - Analog Out Bricklet
          - Barometer Bricklet
          - Color Bricklet
          - Current12 Bricklet
          - Current25 Bricklet
          - Distance IR Bricklet
          - Distance US Bricklet
          - Dual Button Bricklet
          - Dual Relay Bricklet
          - GPS Bricklet
          - Hall Effect Bricklet
          - Humidity Bricklet
          - Industrial Digital In 4 Bricklet
          - Industrial Digital Out 4 Bricklet
          - Industrial Dual 0-20mA Bricklet
          - Industrial Quad Relay Bricklet
          - IO-16 Bricklet
          - IO-4 Bricklet
          - Joystick Bricklet
          - LCD 16x2 Bricklet
          - LCD 20x4 Bricklet
          - LED Strip Bricklet
          - Line Bricklet
          - Linear Poti Bricklet
          - Moisture Bricklet
          - Motion Detector Bricklet
          - Multi Touch Bricklet
          - NFC/RFID Bricklet
          - Piezo Buzzer Bricklet
          - Piezo Speaker Bricklet
          - PTC Bricklet
          - Remote Switch Bricklet
          - Rotary Encoder Bricklet
          - Rotary Poti Bricklet
          - Segment Display 4x7 Bricklet
            - API
              - Basic Functions
              - Advanced Functions
              - Callbacks
          - Solid State Relay Bricklet
          - Sound Intensity Bricklet
          - Temperature Bricklet
          - Temperature IR Bricklet
          - Tilt Bricklet
          - Voltage Bricklet
          - Voltage/Current Bricklet
  - Modbus Protocol
  - Wireshark Dissector

# TCP/IP - Segment Display 4x7 Bricklet

This is the description of the TCP/IP protocol for the Segment Display 4x7 Bricklet. General information and technical specifications for the Segment Display 4x7 Bricklet are summarized in its hardware description.

## API

A general description of the TCP/IP protocol structure can be found here.

### Basic Functions

`BrickletSegmentDisplay4x7.``set_segments`

  Function ID: | 1

  Request:

  - segments -- uint8[4]
  - brightness -- uint8
  - colon -- bool

  Response: | no response

  The 7-segment display can be set with bitmaps. Every bit controls one segment:

  For example to set a "5" you would want to activate segments 0, 2, 3, 5 and 6. This is represented by the number 0b01101101 = 0x6d = 109.

  The brightness can be set between 0 (dark) and 7 (bright). The colon parameter turns the colon of the display on or off.

`BrickletSegmentDisplay4x7.``get_segments`

  Function ID: | 2
  Request: | empty payload

  Response:

  - segments -- uint8[4]
  - brightness -- uint8
  - colon -- bool

  Returns the segment, brightness and color data as set by `set_segments`.

### Advanced Functions

`BrickletSegmentDisplay4x7.``start_counter`

  Function ID: | 3

  Request:

  - value_from -- int16
  - value_to -- int16
  - increment -- int16
  - length -- uint32

  Response: | no response

  Starts a counter with the from value that counts to the to value with the each step incremented by increment. The length of the increment is given in ms.

  Example: If you set from to 0, to to 100, increment to 1 and length to 1000, a counter that goes from 0 to 100 with one second pause between each increment will be started.

  The maximum values for from, to and increment is 9999, the minimum value is -999.

  Using a negative increment allows to count backwards.

  You can stop the counter at every time by calling `set_segments`.

`BrickletSegmentDisplay4x7.``get_counter_value`

  Function ID: | 4
  Request: | empty payload

  Response:

  - value -- uint16

  Returns the counter value that is currently shown on the display.

  If there is no counter running a 0 will be returned.

`BrickletSegmentDisplay4x7.``get_identity`

  Function ID: | 255
  Request: | empty payload

  Response:

  - uid -- char[8]
  - connected_uid -- char[8]
  - position -- char
  - hardware_version -- uint8[3]
  - firmware_version -- uint8[3]
  - device_identifier -- uint16

  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' or 'd'.

  The device identifier numbers can be found here.

### Callbacks

`BrickletSegmentDisplay4x7.``CALLBACK_COUNTER_FINISHED`

  Function ID: | 5
  Response: | empty payload

  This callback is triggered when the counter (see `start_counter`) is finished.

The content of this page is licensed under Creative Commons Attribution 3.0 Unported License.