Announcement

Collapse
No announcement yet.

Compiling geniePi.h

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

  • Compiling geniePi.h

    I am not well versed in gcc and I am trying to compile this program

    HTML Code:
    #include 
    #include 
    #include 
    
    int counter = 0;
    
    int main()
    {
    
    printf("Hello");
    
    if (genieSetup ("/dev/ttyAMA0", 115200) < 0)
     {
     printf("Failed to connect");
     }
    else
     {
     printf("Connected");
     }
    
     for (;
     {
     counter++;
     genieWriteObj (GENIE_OBJ_COOL_GAUGE,    0, counter) ;
     sleep(10);
     }
    
    
    
    return 0;
    }
    
    
    I have compiled it with 
    
    gcc genietest.c -lgeniePi -lwiringPi
    It compiles fine but when I go to run it nothing happens it acts like it is running but it prints nothing.

    I have gotten the kitchen timer example to work and I noticed the make file did a couple of commands that I was not doing and i was wondering if that is the source of my problem.

    Thank you for your help

  • #2


    Hi,

    Yes, can you try using the make file to compile your source code? You will just have to edit the make file that comes with the kitchen timer demo. Pages 37 to 39 of 4D-AN-P4023 ViSi-Genie Connecting a 4D Display to the Raspberry Pi show you how do this is done.
    App notes are here: http://www.4dsystems.com.au/appnotes/


    Regards
    Doff

    Comment


    • #3


      Thank you for your quick response. I tried using the make file like you said and it compiled fine. After some more trial and error I found that it was failing at the genieWriteObj line.

      Embarrassingly the cause of the problem was I had set the baud rate to something other than 115200 on the display a wile back and forgot about it.

      Thanks again for your help.

      Comment

      Working...
      X