No announcement yet.

Alignment of Strings Labels

  • Filter
  • Time
  • Show
Clear All
new posts

  • Alignment of Strings Labels


    for my µLCD-32PTU (Arduino) I am using String Labels to Display temperature values,
    because these Labels are the only way to Display values during the run time of the program.
    But why doesn't work the given alignment attributes for these Labels ?
    No matter what is set in the VisiGenie Workshop Editor, Left, Center or Right.
    The alignment is allways "Left".
    Can you please tell me a way to align it "Center" ?

    Last edited by Magnitudo; 21 December 2014, 04:14 AM.

  • #2
    I think you are using a strings object as there is no alignment attribute for Labels.

    As per the manual the alignment of strings is for static strings only. Dynamic strings must be aligned before being written to the display.

    You do this by prepending spaces to the string, For a proportional font this generally requires 2x the number of spaces as a fixed font does.


    • #3
      i dont want to oben a new thread so here i my question.
      I want do display temperatures valeues too.
      But i get an error.

      genie.WriteStr(1, sensor);
      error: invalid conversation form 'int' to 'char*'

      so i tried it with a char

      error: invalid conversation form 'char' to 'char*'

      I know the * means pointer. But i dont know what to doo



      • #4
        Hello Patric

        It is a Character Array, not a String, that it takes.

        This might be useful for you if you are already dealing with strings.

        else this might be useful information for you



        • complex400
          complex400 commented
          Editing a comment
          Thanks James !!!

      • #5
        Hi Magnitudo,

        You might find this application note helpful:

        ViSi-Genie Labels, Text, and Strings

        Predefined or static strings and dynamic strings are discussed starting on page 12. Also, there are further discussions starting on page 19. On page 20 it says:

        Here is an additional information on strings object from the manual
        (section Strings).
        The first strings are displayed initially. Normally strings are set to
        predefined values, e.g. a value of 0 might display the string ‘Hello
        There’. Using predefined values makes the most efficient use of the
        comms link and also minimizes the code required in your controller.
        In order to display a dynamically created string the user can send
        the Write String ASCII command message. The default maximum
        string length is 75, this can be changed in the Workshop options for
        Genie. For Unicode string objects Unicode strings can be sent, using
        the Write String Unicode command message. CRs and LFs can be
        included and the user is responsible for the ‘formatting’ of the
        string, the formatting of strings in Workshop does not apply to
        dynamic strings.

        Thus, the right -, centre -, or left - alignment of a predefined string when
        being formatted in the strings editor in Workshop does not apply to
        dynamic strings. Furthermore, a dynamic string does not automatically fit
        into the area defined by the strings container object. It will only be printed
        starting at the x and y coordinates of the strings container object.
        Formatting of predefined strings is set during design time, while formatting
        of dynamic strings is up to the host.
        For writing to string objects using the ViSi-Genie-Arduino library, you may refer to

        ViSi-Genie Writing to Genie Objects Using an Arduino Host

        Hope this helps and regards.