Pages: [1]   Go Down
Author Topic: Problema con libreria de Smartgpu2  (Read 356 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Utilizo Arduino uno, sistema operativo Mac os y tengo problema con los ejemplos de la Smartgpu2 el programa es:


Code:
#include <SMARTGPU2.h>     //include the SMARTGPU2 library!

SMARTGPU2 lcd;             //create our object called LCD

/*********************************************************/
/*********************************************************/
void setup() { //initial setup
  //Those two functions must always be called for SMARTGPU2 support
  lcd.init();  //configure the serial and pinout of arduino board for SMARTGPU2 support
  lcd.start(); //initialize the SMARTGPU2 processor
}

/*********************************************************/
/*********************************************************/
/*********************************************************/
/*********************************************************/
void loop() { //main loop draw random colour, size and fill Arcs
    POINT point;
    RADIUS radiusx, radiusy;
    COLOUR colour;
    FILLGEOM fill;
    unsigned int quadrant;
    
    lcd.baudChange(BAUD6);           //for fast drawing we need a big baudRate
    
    while(1){//forever
      randomSeed(random(0,65536));   //set different seeds to obtain a good random number
      point.x=random(0,LCD_WIDTH);   //get a random number 0-319
      point.y=random(0,LCD_HEIGHT);  //get a random number 0-239
      radiusx=random(5,101);         //get a random number 5-100
      radiusy=random(5,101);         //get a random number 5-100
      quadrant=random(1,5);          //get a random number 1-4
      colour=random(0,65536);        //get a random number 0-65535
      fill=(FILLGEOM)random(0,2);    //get a random number 0-1
      
      //draw the Arc
      if(lcd.drawArc(point.x, point.y, radiusx, radiusy, (ARCQUADRANT)quadrant, colour, fill) != 'O'){  //draw an Arc
        while(1);                    //loop forever if different than 'O'--OK
      }      
    }
}

y los problemas son casi similares en todos los ejemplos:
Code:
Arcs:22: error: 'SMARTGPU2' does not name a type
Arcs.ino: In function 'void setup()':
Arcs:28: error: 'lcd' was not declared in this scope
Arcs.ino: In function 'void loop()':
Arcs:37: error: 'POINT' was not declared in this scope
Arcs:37: error: expected `;' before 'point'
Arcs:38: error: 'RADIUS' was not declared in this scope
Arcs:38: error: expected `;' before 'radiusx'
Arcs:39: error: 'COLOUR' was not declared in this scope
Arcs:39: error: expected `;' before 'colour'
Arcs:40: error: 'FILLGEOM' was not declared in this scope
Arcs:40: error: expected `;' before 'fill'
Arcs:43: error: 'lcd' was not declared in this scope
Arcs:43: error: 'BAUD6' was not declared in this scope
Arcs:47: error: 'point' was not declared in this scope
Arcs:47: error: 'LCD_WIDTH' was not declared in this scope
Arcs:48: error: 'LCD_HEIGHT' was not declared in this scope
Arcs:49: error: 'radiusx' was not declared in this scope
Arcs:50: error: 'radiusy' was not declared in this scope
Arcs:52: error: 'colour' was not declared in this scope
Arcs:53: error: 'fill' was not declared in this scope
Arcs:53: error: expected `;' before 'random'
Arcs:56: error: 'ARCQUADRANT' was not declared in this scope

« Last Edit: April 18, 2014, 02:34:23 am by leo72 » Logged

Palencia, Spain
Offline Offline
God Member
*****
Karma: 25
Posts: 506
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Tiene toda la pinta de que no has colocado la librería en el lugar correcto. El archivo SMARTGPU2.h debería estar en la carpeta Arduino/libraries/SMARTGPU2/SMARTGPU2.h. Revisa no hayas creado alguna subcarpeta de más al descomprimir la librería.
Saludos.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

noter, muchas gracias tenias razón la mayoría de los errores se han solucionado pero aun me marca como error:

In file included from Arcs.ino:20:
/Applications/Arduino 4.app/Contents/Resources/Java/libraries/SMARTGPU2/SMARTGPU2.h:69:2: error: #error "No smartGPU2 LCDXXXxXXX board defined in smartGPU2.h file"
Arcs.ino: In function 'void loop()':
Arcs:47: error: 'LCD_WIDTH' was not declared in this scope
Arcs:48: error: 'LCD_HEIGHT' was not declared in this scope

Disculpa mi ignorancia.
Logged

Palencia, Spain
Offline Offline
God Member
*****
Karma: 25
Posts: 506
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Pues viene a decir que no has definido qué dispositivo estás utilizando.
Creo que tienes que editar SMARTGPU2.h (usa un editor de texto) y descomentar la línea que corresponde a tu modelo.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Gracias noter, ya todo esta en orden, te estoy muy agradecida.
Logged

Palencia, Spain
Offline Offline
God Member
*****
Karma: 25
Posts: 506
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Bien está lo que bien acaba. Me alegro de haberte sido de ayuda.
Sería conveniente que cambiaras el asunto del post, precediéndolo de [SOLUCIONADO].
Saludos.
Logged

Pages: [1]   Go Up
Jump to: