Announcement

Collapse
No announcement yet.

invalid preprocessing directive error

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

  • invalid preprocessing directive error

    Hi,

    i am new to 4D displays, playing around to create a car gauge.
    using 160-G2 display in combination with a Arduino Nano.

    Now a made a few images, used widgets - user images to upload them.
    i get a error message, cannot figure out what could be wrong, seems to fail at the automatic created .h file.

    log message is:

    NoName3Const.h:16: error: invalid preprocessing directive #DATA
    #DATA
    ^
    NoName3Const.h:23: error: invalid preprocessing directive #END
    #END
    ^
    exit status 1
    Completed RC=1


    NoName3Const.h file contains

    // File generated 23-12-2017 10:15:23
    // Warning! This is a generated file, any manual changes will be
    // lost during the next generation.

    #if (ARDUINO >= 100)
    #include "Arduino.h" // for Arduino 1.0
    #else
    #include "WProgram.h" // for Arduino 23
    #endif

    // object indexes for Inputs, Image Addresses + Input Array
    iUserimages1
    #define iUserimages1H 0x0000
    #define iUserimages1L 0x0000

    #DATA
    word InputX1 27
    word InputX2 136
    word InputY1 0
    word InputY2 127
    word InputH 0x0000
    word InputL 0x0000
    #END

    var curInput ;


    where could the error be ?

    thanks

  • #2
    Hi

    I will find out why the generated code is like that. Everything up to the #DATA is correct. Your code will compile if this was all commented out as well as the var curInput;

    Best regards

    Paul



    Comment


    • #3
      Thanks for response !, not at home, so tryed to reproduce it, as far as i see i get other error after commeting out:

      script:

      // File generated 23-12-2017 19:58:54
      // Warning! This is a generated file, any manual changes will be
      // lost during the next generation.

      #if (ARDUINO >= 100)
      #include "Arduino.h" // for Arduino 1.0
      #else
      #include "WProgram.h" // for Arduino 23
      #endif

      // object indexes for Inputs, Image Addresses + Input Array
      iUserimages1
      #define iUserimages1H 0x0000
      #define iUserimages1L 0x0000

      // #DATA
      // word InputX1 27
      // word InputX2 136
      // word InputY1 0
      // word InputY2 127
      // word InputH 0x0000
      // word InputL 0x0000
      // #END

      // var curInput ;


      log compiling


      Verifiëren...
      In file included from C:\Users\rtepa\Desktop\test_forum\test_forum.ino:13:0:
      test_forumConst.h:12: error: 'iUserimages1' does not name a type
      iUserimages1
      ^
      In file included from C:\Users\rtepa\Desktop\test_forum\test_forum.ino:15:0:
      C:\Program Files (x86)\Arduino\libraries\Goldelox_Serial_4DLib/Goldelox_Serial_4DLib.h:36:3: error: 'Tcallback4D' does not name a type
      Tcallback4D Callback4D ;
      ^
      C:\Users\rtepa\Desktop\test_forum\test_forum.ino: In function 'void setup()':
      test_forum:61: error: 'class Goldelox_Serial_4DLib' has no member named 'Callback4D'
      Display.Callback4D = mycallback ;
      ^
      C:\Users\rtepa\Desktop\test_forum\test_forum.ino:70:30: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
      Display.putstr("Starting\n") ;
      ^
      C:\Users\rtepa\Desktop\test_forum\test_forum.ino:73:42: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
      Display.putstr("Drive not mounted...");
      ^
      C:\Users\rtepa\Desktop\test_forum\test_forum.ino: In function 'void loop()':
      test_forum:80: error: 'frame' was not declared in this scope
      Display.media_VideoFrame(28, 0, 0) ; // where frame is 0 to 12
      ^
      exit status 1
      Completed RC=1
      Last edited by hendrik6073; 24th December 2017, 04:11 AM.

      Comment


      • #4
        Hi,

        Would you like to send me your arduino code and I will try it here. There are quite a lot of errors in addition to the generated .h file.

        Best regards

        Paul

        Comment


        • #5
          of course !

          //
          // NB! This is a file generated from the .4Dino file, changes will be lost
          // the next time the .4Dino file is built
          //
          // Define LOG_MESSAGES to a serial port to send SPE errors messages to. Do not use the same Serial port as SPE
          //#define LOG_MESSAGES Serial

          #define RESETLINE 4

          #define DisplaySerial Serial


          #include "test_forumConst.h"

          #include "Goldelox_Serial_4DLib.h"
          #include "Goldelox_Const4D.h"

          Goldelox_Serial_4DLib Display(&DisplaySerial);


          // routine to handle Serial errors
          void mycallback(int ErrCode, unsigned char Errorbyte)
          {
          #ifdef LOG_MESSAGES
          const char *Error4DText[] = {"OK\0", "Timeout\0", "NAK\0", "Length\0", "Invalid\0"} ;
          LOG_MESSAGES.print(F("Serial 4D Library reports error ")) ;
          LOG_MESSAGES.print(Error4DText[ErrCode]) ;
          if (ErrCode == Err4D_NAK)
          {
          LOG_MESSAGES.print(F(" returned data= ")) ;
          LOG_MESSAGES.println(Errorbyte) ;
          }
          else
          LOG_MESSAGES.println(F("")) ;
          while (1) ; // you can return here, or you can loop
          #else
          // Pin 13 has an LED connected on most Arduino boards. Just give it a name
          #define led 13
          while (1)
          {
          digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
          delay(200); // wait for a second
          digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
          delay(200); // wait for a second
          }
          #endif
          }
          // end of routine to handle Serial errors

          void setup()
          {
          // Ucomment to use the Serial link to the PC for debugging
          // Serial.begin(115200) ; // serial to USB port
          // Note! The next statement will stop the sketch from running until the serial monitor is started
          // If it is not present the monitor will be missing the initial writes
          // while (!Serial) ; // wait for serial to be established

          pinMode(RESETLINE, OUTPUT); // Display reset pin
          digitalWrite(RESETLINE, 0); // Reset Display, without shield
          delay(100); // wait for it to be recognised
          digitalWrite(RESETLINE, 1); // Release Display Reset, without shield
          delay(3000) ; // give display time to startup

          // now start display as Serial lines should have 'stabilised'
          DisplaySerial.begin(38400) ; // Hardware serial to Display, same as SPE on display is set to
          Display.TimeLimit4D = 5000 ; // 5 second timeout on all commands
          Display.Callback4D = mycallback ;

          Display.gfx_ScreenMode(LANDSCAPE) ; // change manually if orientation change
          Display.putstr("Starting\n") ;
          while(!Display.media_Init())
          {
          Display.putstr("Drive not mounted...");
          delay(200);
          Display.gfx_Cls();
          delay(200);
          }
          // put your setup code here, to run once:
          } // end Setup **do not alter, remove or duplicate this line**

          void loop()
          {
          // put your main code here, to run repeatedly:

          Display.media_SetAdd(iUserimages1H, iUserimages1L) ; // point to the Userimages1 Userimages1 image
          Display.media_VideoFrame(28, 0, 0) ; // where frame is 0 to 12



          }

          Comment


          • #6
            only happen with user images, rest works fine ......

            Comment


            • #7
              are there things i could test myself ? could this be a board specific error ? i only have 1 flavour to test with. thanks !

              Comment

              Working...
              X