7 Replies Latest reply on Sep 2, 2014 1:37 PM by hutley421

    Gameduino for Intel Galileo

    hutley421

      Hello,

      I have recently bought an Intel Galileo and a Gameduino shield, however when I go to program using the Arduino/Intel Galileo programming program I get a load of errors. I have added all the correct libraries.

      I tried the same code on the regular Arduino programming program and I got no errors when I verified the code however this program in incompatible with the Intel Galileo.

       

      Please Help!! smiley

      PS: when I say the "Arduino/Intel Galileo programming program" I mean the IDE

       

      PPS: These are the errors I receive when using the Arduino/Intel Galileo programming program :

       

      "Arduino: 1.5.3 (Windows 7), Board: "Intel® Galileo Gen2

       

      C:\arduino-1.5.3/hardware/tools/x86/i686-pokysdk-mingw32/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++ -m32 -march=i586 --sysroot=C:\arduino-1.5.3/hardware/tools/x86/i586-poky-linux-uclibc -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -D__ARDUINO_X86__ -Xassembler -mquark-strip-lock=yes -march=i586 -m32 -DARDUINO=153 -IC:\arduino-1.5.3\hardware\arduino\x86\cores\arduino -IC:\arduino-1.5.3\hardware\arduino\x86\variants\galileo_fab_g -IC:\arduino-1.5.3\hardware\arduino\x86\libraries\SPI -IC:\Users\Edward\Documents\Arduino\libraries\Gameduino C:\Users\Edward\AppData\Local\Temp\build1589179656806897591.tmp\sprites256.cpp -o C:\Users\Edward\AppData\Local\Temp\build1589179656806897591.tmp\sprites256.cpp.o

       

      In file included from sprites256.ino:2:0:

      C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:50:39: error: 'prog_uchar' has not been declared

      C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:61:25: error: 'prog_uchar' has not been declared

      C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:62:45: error: 'prog_uchar' has not been declared

      C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h: In member function 'int Asset::open(const char*, ...)':

      C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:183:7: error: 'va_list' was not declared in this scope

      C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:183:15: error: expected ';' before 'ap'

      C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:184:16: error: 'ap' was not declared in this scope

      C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:184:21: error: 'va_start' was not declared in this scope

      C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:192:24: error: expected primary-expression before 'const'

      C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:192:36: error: 'va_arg' was not declared in this scope

      In file included from sprites256.ino:4:0:

      pickups2.h: At global scope:

      pickups2.h:1:16: error: 'prog_uchar' does not name a type

      pickups2.h:887:16: error: 'prog_uchar' does not name a type

      In file included from sprites256.ino:5:0:

      sprites256.h:1:16: error: 'prog_uchar' does not name a type

      sprites256.h:275:16: error: 'prog_uchar' does not name a type

      sprites256.h:530:16: error: 'prog_uchar' does not name a type

      sprites256.ino: In function 'void setup()':

      sprites256.ino:60:20: error: 'sprites256_pic' was not declared in this scope

      sprites256.ino:61:20: error: 'sprites256_chr' was not declared in this scope

      sprites256.ino:62:20: error: 'sprites256_pal' was not declared in this scope

      sprites256.ino:64:23: error: 'pickups2_img' was not declared in this scope

      sprites256.ino:65:23: error: 'pickups2_pal' was not declared in this scope"

        • 1. Re: Gameduino for Intel Galileo
          Rushang.Karia

          I am not sure if this a correct answer but this is what I found when I looked the GD.h header file.

           

          line 15:

          #ifdef BOARD_maple //REMOVE THIS

           

          #include "wirish.h"

           

          typedef const unsigned char prog_uchar;

          #define Serial SerialUSB

          #define pgm_read_byte_near(x) (*(prog_uchar*)x)

          #define pgm_read_byte(x) (*(prog_uchar*)x)

          #define PROGMEM const

           

          extern HardwareSPI SPI;

           

          #include <stdio.h>

          #include <stdint.h>

          #include <string.h>

          #endif //REMOVE THIS

           

          Remove the ifdefs and try to compile again. I do not know if this will work but it is worth a shot.

          • 2. Re: Gameduino for Intel Galileo
            hutley421

            hello,

            ook now the only error I get is saying that it can't locate "wirish.h", which isnt in the libary folder I downloaded and i can't find it on the internet.

            many thanks

            • 3. Re: Gameduino for Intel Galileo
              Rushang.Karia

              replace the line #include"wirish.h" with the following

               

              #define HIGH 0x1

              #define LOW  0x0

               

              #define true 0x1

              #define false 0x0

               

              #define LSBFIRST 0

              #define MSBFIRST 1

               

              #define lowByte(w)                     ((w) & 0xFF)

              #define highByte(w)                    (((w) >> 8) & 0xFF)

              #define bitRead(value, bit)            (((value) >> (bit)) & 0x01)

              #define bitSet(value, bit)             ((value) |= (1UL << (bit)))

              #define bitClear(value, bit)           ((value) &= ~(1UL << (bit)))

              #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : \

                                                                 bitClear(value, bit))

              #define bit(b)                         (1UL << (b))

               

              typedef uint8 boolean;

              typedef uint8 byte;

               

              You might face more compiler errors after this since wirish.h also includes a hell of other things. But if your application does not use them then I think it should work.

               

              Here is the sourcecode for wirish.h

              http://static.leaflabs.com/pub/leaflabs/maple-ide/maple-ide-0.0.12-src/hardware/leaflabs/cores/maple/wirish.h

              • 4. Re: Gameduino for Intel Galileo
                hutley421

                ok I think i fixed the wirish.h problem... i downloaded the whole libmaple-master and changed the include"wire.h" to #include C:xx\xx\xx\xx\xx/wirish.h because the wirish.h need lots of .h files as well.

                now, as before, have have a lot of 'not declared' errors however the variables that its saying are not declared don't seem like variables at all:

                 

                [quote]

                Arduino: 1.5.3 (Windows 7), Board: "Intel® Galileo Gen2"

                 

                 

                C:\arduino-1.5.3/hardware/tools/x86/i686-pokysdk-mingw32/usr/bin/i586-poky-linux-uclibc/i586-poky-linux-uclibc-g++ -m32 -march=i586 --sysroot=C:\arduino-1.5.3/hardware/tools/x86/i586-poky-linux-uclibc -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -D__ARDUINO_X86__ -Xassembler -mquark-strip-lock=yes -march=i586 -m32 -DARDUINO=153 -IC:\arduino-1.5.3\hardware\arduino\x86\cores\arduino -IC:\arduino-1.5.3\hardware\arduino\x86\variants\galileo_fab_g -IC:\arduino-1.5.3\hardware\arduino\x86\libraries\SPI -IC:\Users\Edward\Documents\Arduino\libraries\Gameduino C:\Users\Edward\AppData\Local\Temp\build3193346730178134688.tmp\sprites256.cpp -o C:\Users\Edward\AppData\Local\Temp\build3193346730178134688.tmp\sprites256.cpp.o

                 

                 

                In file included from sprites256.pde:2:0:

                C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:15:10: error: #include expects "FILENAME" or <FILENAME>

                C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:234:2: error: #endif without #if

                C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:16:9: error: 'uint8' does not name a type

                C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:17:9: error: 'uint8' does not name a type

                C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:25:8: error: 'HardwareSPI' does not name a type

                C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h: In member function 'int Asset::open(const char*, ...)':

                C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:183:7: error: 'va_list' was not declared in this scope

                C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:183:15: error: expected ';' before 'ap'

                C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:184:16: error: 'ap' was not declared in this scope

                C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:184:21: error: 'va_start' was not declared in this scope

                C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:192:24: error: expected primary-expression before 'const'

                C:\Users\Edward\Documents\Arduino\libraries\Gameduino/GD.h:192:36: error: 'va_arg' was not declared in this scope

                [/quote]

                 

                I'm trying to run the sqrites256 example if that helps, however all the examples have errors.

                 

                thanks for your help so far.

                • 5. Re: Gameduino for Intel Galileo
                  hutley421

                  the sqrites256 code is:

                   

                  [quote]

                  #include <[color=#CC6600]SPI[/color].h>

                  #include <GD.h>

                   

                   

                  #include [color=#006699]"pickups2.h"[/color]

                  #include [color=#006699]"sprites256.h"[/color]

                   

                   

                  struct sprite

                  {

                    [color=#CC6600]int[/color] x;

                    [color=#CC6600]int[/color] y;

                    [color=#CC6600]char[/color] vx, vy;

                  } sprites[256];

                   

                   

                  [color=#CC6600]void[/color] plot()

                  {

                    [color=#CC6600]int[/color] i;

                    [color=#CC6600]for[/color] (i = 0; i < 256; i++) {

                      GD.sprite(i, sprites[i].x >> 4, sprites[i].y >> 4, i % 47, 0, 0);

                    }

                  }

                   

                   

                  #define LWALL (0 << 4)

                  #define RWALL (384 << 4)

                  #define TWALL (0 << 4)

                  #define BWALL (284 << 4)

                   

                   

                  [color=#CC6600]void[/color] [color=#CC6600]move[/color]()

                  {

                    [color=#CC6600]int[/color] i;

                    sprite *ps;

                   

                   

                    [color=#CC6600]for[/color] (i = 256, ps = sprites; i--; ps++) {

                      [color=#CC6600]if[/color] ((ps->x <= LWALL)) {

                        ps->x = LWALL;

                        ps->vx = -ps->vx;

                      }

                      [color=#CC6600]if[/color] ((ps->x >= RWALL)) {

                        ps->x = RWALL;

                        ps->vx = -ps->vx;

                      }

                      [color=#CC6600]if[/color] ((ps->y <= TWALL)) {

                        ps->y = TWALL;

                        ps->vy = -ps->vy;

                      }

                      [color=#CC6600]if[/color] ((ps->y >= BWALL)) {

                        ps->y = BWALL;

                        ps->vy = -ps->vy;

                      }

                      ps->x += ps->vx;

                      ps->y += ps->vy;

                    }

                  }

                   

                   

                  [color=#CC6600]void[/color] [color=#CC6600][b]setup[/b][/color]()

                  {

                    [color=#CC6600]int[/color] i;

                   

                   

                    GD.[color=#CC6600]begin[/color]();

                   

                    GD.copy(RAM_PIC, sprites256_pic, sizeof(sprites256_pic));

                    GD.copy(RAM_CHR, sprites256_chr, sizeof(sprites256_chr));

                    GD.copy(RAM_PAL, sprites256_pal, sizeof(sprites256_pal));

                   

                   

                    GD.copy(RAM_SPRIMG, pickups2_img, sizeof(pickups2_img));

                    GD.copy(RAM_SPRPAL, pickups2_pal, sizeof(pickups2_pal));

                   

                   

                    [color=#CC6600]for[/color] (i = 0; i < 256; i++) {

                      sprites[i].x = [color=#CC6600]random[/color](400 << 4);

                      sprites[i].y = [color=#CC6600]random[/color](300 << 4);

                      sprites[i].vx = [color=#CC6600]random[/color](-16,16);

                      sprites[i].vy = [color=#CC6600]random[/color](-16,16);

                    }

                  }

                   

                   

                  [color=#CC6600]void[/color] [color=#CC6600][b]loop[/b][/color]()

                  {

                    plot();

                    [color=#CC6600]move[/color]();

                  }

                   

                   

                  [/quote]

                  • 6. Re: Gameduino for Intel Galileo
                    Rushang.Karia

                    can you post the code without the color =*

                    • 7. Re: Gameduino for Intel Galileo
                      hutley421

                      hello, sorry for the late reply, I've been on holiday. I don't understand what you mean by "without the color =*" this was copied and pasted straight from the program.

                      Ultimately I want to you the VGA to display c++ program on a screen I all ready own in colour. This screen supports VGA, HDMI and RCA. If you know another way to connect the screen to the board and how to code so that the GUI will be displayed on a screen it would be much appreciated. The Intel Galileo is running Debian which will execute the c++ program, would I be able to have the command line Debian displayed on screen, as if the Galileo was a regular computer running Debian and video was being sent down an integrated VGA port. Thank you so much for your help so far it's been great