Announcement

Collapse
No announcement yet.

Problems with the library

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problems with the library

    Hello,

    I am new with the 4D systems displays and library.
    At this point I can lower the brightness of the screen from the arduino ( genie.WriteContrast(1) ). But when using genieWriteObj it keeps saying 'genieWriteObj' was not declared in this scope.
    I downloaded the first library I could find from githud. Do not know if it is the right one.

    I am using a gen4-ulcd-43DCT-CLB-AR with a arduino uno.

    This is the code I am trying to run. It is just to make a gauge move.
    Code:
    #include <genieArduino.h>
    
    Genie genie;
    
    #define RESETLINE 4  // Change this if you are not using an Arduino Adaptor Shield Version 2 (see code below)
    
    // Setup function
    void setup()
    {
      // NOTE, the genieBegin function (e.g. genieBegin(GENIE_SERIAL_0, 115200)) no longer exists.  
      // Use a Serial Begin and serial port of your choice in your code and use the genie.Begin function to send 
      // it to the Genie library (see this example below)
      // max of 200K Baud is good for most Arduinos. Galileo should use 115200 or below.  
      Serial.begin(9600);  // Serial0 @ 9600 Baud
      genie.Begin(Serial);   // Use Serial0 for talking to the Genie Library, and to the 4D Systems display
      
      // Reset the Display (change D4 to D2 if you have original 4D Arduino Adaptor)
      // THIS IS IMPORTANT AND CAN PREVENT OUT OF SYNC ISSUES, SLOW SPEED RESPONSE ETC
      // If NOT using a 4D Arduino Adaptor, digitalWrites must be reversed as Display Reset is Active Low, and
      // the 4D Arduino Adaptors invert this signal so must be Active High.  
      pinMode(RESETLINE, OUTPUT);  // Set D4 on Arduino to Output (4D Arduino Adaptor V2 - Display Reset)
      digitalWrite(RESETLINE, 1);  // Reset the Display via D4
      delay(100);
      digitalWrite(RESETLINE, 0);  // unReset the Display via D4
    
      delay (3500); //let the display start up after the reset (This is important)
    }
    
    
    void loop() {  
    
    genieWriteObj (GENIE_OBJ_FORM, 0,0);
    
    int x;
    x++;
    
    
    genieWriteObj (GENIE_OBJ_GAUGE, 0, x);
    delay (250);
    }
    What am I doing wrong?

  • #2
    Hi,

    You used the function "genieWriteObj() " instead of genie.WriteObject() .
    Kindly view the sample codes in the library for references.

    Best regards

    Vince
    Vince_4D

    Comment


    • #3
      Hello,

      Thank you! I will try this on a screen later today. But the arduino software compiled it so I am positive that it is going to work. I tried genieWriteObj() and genie.WriteObj() because I was using this video as a reference.

      https://youtu.be/L1TPs6dI11k

      Comment


      • #4
        Hi there,

        The library that was used in that video (SparkFun) was created five years ago.
        Since you compiled the program with no error, the library that you used might be an updated one.

        You can check here the contents of the library for further analysis: https://github.com/4dsystems/ViSi-Ge...genieArduino.h

        Have fun exploring ...

        Vince

        Vince_4D

        Comment


        • #5
          Comment on that video:

          Click image for larger version

Name:	2018-03-27_15-22-33.png
Views:	1
Size:	23.9 KB
ID:	62606

          Click image for larger version

Name:	2018-03-27_15-24-07.png
Views:	1
Size:	42.1 KB
ID:	62607

          Here is the current link:
          https://www.4dsystems.com.au/appnote/4D-AN-00025/
          James

          Comment


          • #6
            It works! Thanks guys. I didn't look at the comments (I should have).

            Comment

            Working...
            X