Pages: [1] 2   Go Down
Author Topic: Nokia6100 philips e arduino Uno  (Read 1449 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Salve, sono nuovo del forum ma vi seguo da parecchio tempo!

Ho iniziato la mia nuova avventura con arduino e sto provando la board Nokia 6100 sparkfun Philips http://www.sparkfun.com/products/9363 insieme ad arduino Uno.

Ho inserito la libreria: https://github.com/downloads/jimbloom/ColorLCDShield/ColorLCDShield-11-3-11.zip

ed ho provato alcuni esempi. Poi ho voluto provare a far stampare sul display un'icona da me creata(ho provato con più programmi a convertire da bmp a rgb 12bit) ma non son riuscito nell'impresa.

Come posso risolvere? La libreria che sto usando è quella giusta?

Grazie
Logged

Monselice PD Italy
Offline Offline
Faraday Member
**
Karma: 26
Posts: 5500
фон Крыса
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Se tutto il resto funziona allora la libreria è giusta e forse sbagli qualcos'altro.. io non l'ho mai usato però se posti il codice magari risolviamo smiley
Logged

Se corri veloce come un fulmine, ti schianterai come un tuono.

BZ (I)
Offline Offline
Brattain Member
*****
Karma: 263
Posts: 21601
+39 349 2158303
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

non é che ci sono problemi con la quantitá di RAM del ATmega?
Ciao Uwe
Logged

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

allego il codice per la stampa, l'arai dell'icona, ed il risultato:

quello che dovrebbe uscire è questo: http://3.bp.blogspot.com/_Y2GjZthrcqI/S8V-TB_HvhI/AAAAAAAAAGk/LefW8Ilcyug/s1600/fiammella.gif

Stampa:
Code:
void LCDShield::printfiamma(int xps, int yps)
{
    int count = 0;
    for (int j = 0; j < sheight; j++) {
        for (int i = 0; i < swidth; i++) {
             setPixel(pgm_read_word_near(fiammella + count),yps+j,xps+i);
             count++;
        }
    }
}

Array icona:
Code:
static int swidth = 17;
static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,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,};


* IMG_0289.JPG (98.93 KB, 800x598 - viewed 24 times.)
« Last Edit: November 28, 2011, 02:10:51 pm by nextor » Logged

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

Sono riuscito a stampare quasi correttamente l'icona modificando la stringa setPixel in questo modo:
setPixel(pgm_read_word_near(fiammella + count),xps+j,yps+i);

però l'icona esce tagliata, per farla uscire integra devo modificare il valore di swidth da 17 a 25 come sheight.

Il problema è che la fiamma non esce della stessa forma ma viene stampata più larga e tutta allineata a sx, quindi non rispetta la foto reale...e i colori non vengono rispettati, anzi viene stampato con una specie di verde/nero.

Non ho avuto molto altro tempo per provare, ma secondo voi da cosa può dipendere?
Logged

Global Moderator
Italy
Offline Offline
Brattain Member
*****
Karma: 328
Posts: 22762
Logic is my way
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Con la libreria c'era un esempio? L'esempio funziona?
Logged


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

Si, c'è il logo Sparkfun, però non è colorato, ètutto rosso ed ha una routine fatta a posta per lui...se non sbaglio la trovi nel file allegato all'interno del file ColorShieldLCD.ccp e si chiama "printlogo"

Cmq sia la allego:
Code:
void LCDShield::printLogo(void)
{
        int x = 4, y = 25, logo_ix = 0, z;
        char logo;
        for (logo_ix = 0; logo_ix < 1120; logo_ix++)
        {
                logo = logo_spark[logo_ix];
                for (z = 0; z < 8; z++)
                {
                        if ((logo & 0x80) == 0x80) setPixel(RED, y, x);
                        x++;
                        if (x == 132)
                        {
                                x = 4;
                                y++;
                        }
                        logo <<= 1;
                }
        }
}
Logged

Global Moderator
Italy
Offline Offline
Brattain Member
*****
Karma: 328
Posts: 22762
Logic is my way
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quindi mi viene da pensare che la conversione che tu hai fatto sia errata.
Logged


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

per convertire l'icona da bmp a rgb 12bit utilizzo "BMP CONVERT 2.0.0"

ho provato sia con 12bitA sia con 12bitB ma non è cambiato granché...

cosa potrei utilizzare? il codice da me in uso è giusto?
Logged

Global Moderator
Italy
Offline Offline
Brattain Member
*****
Karma: 328
Posts: 22762
Logic is my way
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

non conosco lo shield. Però ho visto che sul sito di Sparkfun ci sono un sacco di commenti e diversi link a tutorial e codici di esempio.

PS:
GIMP non ti converte un file in RGB?
Logged


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

Gli ho visti quasi tutti i link nei commenti di Sparkfun e la maggiorparte sono per chip Epson

Cmq appena torno a casa provo a convertire con Gimp...non sapevo di questa funzione.

Logged

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

Ho importato l'immagine bmp in GIMP e l'ho salvata in "codice sorgente C", me l'ha data lui...

Questo è quello che mi ha salvato:

Code:
/* GIMP RGB C-Source image dump (fiammella.c) */

static const struct {
  unsigned int width;
  unsigned int height;
  unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */
  unsigned char pixel_data[10 * 24 * 3 + 1];
} gimp_image = {
  10, 24, 3,
  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\320\215"
  "\377\354\262\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
  "\377\377\377\377\377\377\377\377\377\377\330\230\377\225?\377\377\377\377"
  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
  "\377\377\377\330\230\377f\0\377\377\377\377\377\377\377\377\377\377\377\377"
  "\377\377\377\377\377\377\377\377\377\377\377\377\377\312\206\377f\0\377q"
  "\17\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
  "\377\377\377\377\266k\377f\0\377f\0\377\246V\377\377\377\377\377\377\377"
  "\377\377\377\377\377\377\377\377\377\377\377\377\2154\377f\0\377w\26\377"
  "i\4\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
  "\377i\4\377f\0\377\222;\377w\26\377\261d\377\377\377\377\377\377\377\377"
  "\377\377\377\377\377\246V\377f\0\377f\0\377\250b\377\341\302\377\2120\377"
  "\377\377\377\377\377\377\377\377\377\377\377\377f\0\377f\0\377f\0\377\326"
  "\264\377\375\370\377y\32\377\377\377\377\377\377\377\377\377\377y\32\377"
  "f\0\377f\0\377f\0\377\364\351\377\377\376\377t\22\377\377\377\377\377\377"
  "\377\2208\377f\0\377f\0\377f\0\377f\0\377\372\361\377\377\377\377|\36\377"
  "\377\377\377\274s\377f\0\377f\0\377f\0\377f\0\377\251Y\377\377\377\377\370"
  "\357\377\230B\377\377\377\377n\13\377f\0\377f\0\377f\0\377\2120\377\377\377"
  "\377\377\377\377\230B\377\277v\377\377\377\377f\0\377f\0\377f\0\377x\31\377"
  "\377\377\377\377\377\377\377\377\377n\13\377\377\377\377\246V\377f\0\377"
  "f\0\377f\0\377\377\377\377\377\377\377\377\377\377\307\202\377\210-\377\377"
  "\377\377\210-\377f\0\377f\0\377k\7\377\377\377\377\377\377\377\377\377\377"
  "\205)\377\307\202\377\377\377\377w\26\377f\0\377f\0\377\2120\377\377\377"
  "\377\377\377\377\377\377\377w\26\377\377\377\377\377\377\377w\26\377f\0\377"
  "f\0\377\2208\377\377\377\377\377\377\377\236J\377\271o\377\377\377\377\377"
  "\377\377\2154\377f\0\377f\0\377\2120\377\377\377\377\377\377\377q\17\377"
  "\377\377\377\377\377\377\377\377\377\271o\377f\0\377f\0\377\177\"\377\377"
  "\377\377\243R\377\277v\377\377\377\377\377\377\377\377\377\377\377\377\377"
  "y\32\377f\0\377k\7\377\377\377\377\210-\377\377\377\377\377\377\377\377\377"
  "\377\377\377\377\377\377\377\325\224\377f\0\377f\0\377\230B\377\377\377\377"
  "\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377\377"
  "\271o\377f\0\377\243R\377\377\377\377\377\377\377\377\377\377\377\377\377"
  "\377\377\377\377\377\377\377\377\377\377\377\377\274s\377\377\377\377\377"
  "\377\377\377\377\377\377\377\377\377\377\377\377\377",
};

Ora come faccio?
Logged

Global Moderator
Italy
Offline Offline
Brattain Member
*****
Karma: 328
Posts: 22762
Logic is my way
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Includi questo file nello sketch principale dopodiché hai l'immagine come array denominato pixel_data.
A questo punto devi vedertela tu, non so come funzioni la lib di Sparkfun  smiley-grin
Logged


Roma
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Scusatemi, sono nuovo del forum ed ho bisogno di un aiutino.
Ho montato un Color LCD Shield della Sparkfun con il display Nokia 6100 su controller EPSON.
Una volta caricato uno sketch qualunque di esempio dalla loro libreria mi compare un errore di compliazione:

Code:
In file included from ChronoLCD_Color.cpp:25:
I:\Documents and Settings\Alessandro\Desktop\arduino-1.0\libraries\ColorLCDShield/ColorLCDShield.h:20:22: error: WProgram.h: No such file or directory
In file included from I:\Documents and Settings\Alessandro\Desktop\arduino-1.0\hardware\arduino\cores\arduino/Arduino.h:212,
                 from ChronoLCD_Color.cpp:45:
I:\Documents and Settings\Alessandro\Desktop\arduino-1.0\hardware\arduino\variants\standard/pins_arduino.h:43: error: expected unqualified-id before numeric constant
I:\Documents and Settings\Alessandro\Desktop\arduino-1.0\hardware\tools\avr\bin\avr-ar: WInterrupts.c.o: No such file or directory

La compilazione è stata tentata sia su Arduino UNO che Duemilanove/328.

HELP HELP HELP  smiley-red smiley-red smiley-red
Logged

Bergamo
Offline Offline
God Member
*****
Karma: 1
Posts: 663
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ciao

(ti conviene aprire un altro thread visto che la tua è una richiesta "indipendente" dal thread attuale)
così a occhio direi che quella libreria è fatta per il "vecchio" ide, prova a compilare il tuo sketch con quello (0.22 va benone)
Logged

lucadentella.it

Pages: [1] 2   Go Up
Jump to: