No announcement yet.

In need of a Byte Variable

  • Filter
  • Time
  • Show
Clear All
new posts

  • In need of a Byte Variable

    Hello there,

    I'm in the middle of making a smaller project, and have run into a bit of a wall, I need to control an I2C potentiometer with one of your Diablo16 Displays, however it only takes 1 byte of data, and i haven't been able to find a variable type in your programmers reference that i can utilize for this, I almost used the #Data arrays to make a byte array i could use, until i realized it was Read-Only, which doesn't help me much.

    In short, i need an 8-bit variable that i can both read and write to during run-time, and haven't been able to find anything i can use.
    Is there something I'm missing?

  • #2

    As you may already know, in 4DGL variables are only defined with the var statement.
    Click image for larger version  Name:	var.PNG Views:	0 Size:	5.4 KB ID:	71721

    Please have a look at the LObyte and HIbyte in the DIABLO16 Internal Functions Manual (page 112-113), which you could use to return the lower byte or higher byte of a 16 bit variable.

    Kind regards,
    Last edited by sherwin4D; 3 April 2020, 03:23 PM.


    • #3
      I'll see if i can make that work, will report back when i've tried it


      • sherwin4D
        sherwin4D commented
        Editing a comment
        Yes, sure. Please do update us on the status.

        Kind regards,