Pages: [1]   Go Down
Author Topic: Problème bibliothèque LCD12864R  (Read 1006 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Bonsoir,

je suis entrain d'essayer de tester mon écran LCD 128*64 de dfrobot mais lorsque je vérifie le script test :
Quote
/*
LCD  Arduino
RS = 17; Analog Pin3
RW = 16; Analog Pin2
EN = 18; Analog Pin4
D0  = 8; 
D1  = 9;
D2  = 10; 
D3  = 11; 
D4  = 4;
D5  = 5; 
D6  = 6; 
D7  = 7;
PIN15 PSB = 5V;
*/

#include "LCD12864R.h"
#define AR_SIZE( a ) sizeof( a ) / sizeof( a[0] )

unsigned char show0[]={0xBB,0xFA,0xC6,0xF7,0xC8,0xCB,0xC3,0xCE,0xB9,0xA4,0xB3,0xA7};//机器人梦工厂
unsigned char show1[]="www.dfrobot.com";//
 
unsigned char logo[]={
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x1F,
      0xF0,0x3F,0xFE,0x03,0xFF,0x07,0xFF,0xF0,
      0x04,0x00,0x0F,0x00,0x0F,0xFF,0xF0,0x7F,
      0xFC,0x3F,0xFF,0x0F,0xFF,0x87,0xFF,0xF0,
      0x04,0x00,0x07,0x00,0x0F,0xF0,0x38,0xFE,
      0x0E,0x3E,0x07,0x9F,0xC1,0xC0,0x7E,0x00,
      0x04,0x00,0x07,0x00,0x0F,0xF0,0x19,0xFC,
      0x07,0x3E,0x03,0x9F,0x80,0xE0,0x7E,0x00,
      0x04,0x00,0x07,0x1F,0xFF,0xF0,0x39,0xF8,
      0x03,0x3E,0x03,0xBF,0x00,0x60,0x7E,0x00,
      0x04,0x7F,0xC7,0x0F,0xFF,0xFF,0xF1,0xF8,
      0x03,0x3F,0xFF,0x3F,0x00,0x30,0x7E,0x00,
      0x04,0x7F,0xC7,0x00,0x0F,0xFF,0xF1,0xF8,
      0x01,0x3F,0xFF,0x3F,0x00,0x30,0x7E,0x00,
      0x04,0x7F,0xC7,0x00,0x0F,0xF0,0x39,0xF8,
      0x03,0x3E,0x07,0xBF,0x00,0x30,0x7E,0x00,
      0x04,0x7F,0xC7,0x00,0x0F,0xF0,0x19,0xF8,
      0x03,0x3E,0x03,0xBF,0x00,0x30,0x7E,0x00,
      0x04,0x00,0x07,0x1F,0xFF,0xF0,0x19,0xF8,
      0x07,0x3E,0x03,0x9F,0x80,0x60,0x7E,0x00,
      0x04,0x00,0x07,0x1F,0xFF,0xF0,0x18,0xFC,
      0x0E,0x3E,0x07,0x9F,0xC0,0xE0,0x7E,0x00,
      0x04,0x00,0x07,0x1F,0xFB,0xF0,0x18,0xFF,
      0xBC,0x3F,0xFF,0x0F,0xF3,0xC0,0x3E,0x00,
      0x04,0x00,0x0F,0x1F,0xF8,0xF0,0x18,0x3F,
      0xF0,0x0F,0xFC,0x03,0xFF,0x00,0x1E,0x00,
      0x07,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x07,0xC1,0xC0,0x00,0x07,0xC0,
      0x00,0x3F,0xC0,0x00,0x00,0x00,0x00,0x00,
      0x01,0xFE,0x1F,0xC7,0xE0,0x3E,0x1F,0xE0,
      0x7E,0x3F,0xC0,0x1F,0x07,0xE0,0x71,0xC0,
      0x03,0xFF,0x3C,0x0F,0xF0,0xFF,0x3D,0xE1,
      0xFE,0x3F,0x00,0x7E,0x1F,0xE0,0x71,0xC0,
      0x03,0x8F,0xB8,0x0E,0x71,0xE7,0x38,0xC3,
      0xC7,0x0E,0x00,0xF0,0x3C,0x70,0xF1,0xC0,
      0x03,0x0F,0xB8,0x1C,0x63,0xC3,0xB1,0xC7,
      0x83,0x06,0x00,0xE0,0x78,0x30,0xFB,0xC0,
      0x03,0x07,0xB8,0x1C,0xE3,0x83,0xB3,0x87,
      0x07,0x06,0x01,0xC0,0x70,0x70,0xFF,0xE0,
      0x03,0x0F,0x3F,0x1F,0xC7,0x07,0x3F,0xCE,
      0x07,0x06,0x01,0xC0,0xE0,0x71,0xFF,0xE0,
      0x03,0x1F,0x3F,0x1F,0x87,0x07,0x3F,0xEE,
      0x0E,0x06,0x01,0xC0,0xE0,0xE1,0xDE,0x60,
      0x03,0x3E,0x18,0x1F,0xC7,0x0F,0x38,0xEE,
      0x0E,0x06,0x01,0xC0,0xE0,0xE1,0x9E,0x60,
      0x03,0xF8,0x18,0x1F,0xF7,0x9E,0x31,0xCF,
      0x1C,0x06,0x00,0xFC,0xF1,0xC3,0x9C,0x70,
      0x03,0xF0,0x18,0x1C,0x73,0xFC,0x3B,0xC7,
      0xF8,0x06,0x1C,0xFC,0x7F,0x83,0x9C,0x70,
      0x03,0xC0,0x18,0x1C,0x03,0xF0,0x3F,0x07,
      0xF0,0x04,0x1C,0x3C,0x7F,0x03,0x00,0x60,
      0x00,0x00,0x00,0x0C,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
};

void setup()
{
LCDA.Initialise(); // INIT SCREEN
delay(100);
LCDA.DrawFullScreen(logo);//显示LOGO
delay(3000);
}

void loop()
{
while(1);
}


un message d'erreur apparaît :


Quote

C:\Users\goetschit\Arduino_Leonardo\ProgrammationArduino\libraries\LCD12864R\LCD12864R.cpp: In member function 'void LCD12864R::setPins(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)':
C:\Users\goetschit\Arduino_Leonardo\ProgrammationArduino\libraries\LCD12864R\LCD12864R.cpp:29: error: 'digitalWrite' was not declared in this scope
C:\Users\goetschit\Arduino_Leonardo\ProgrammationArduino\libraries\LCD12864R\LCD12864R.cpp: In member function 'void LCD12864R::delayns()':
C:\Users\goetschit\Arduino_Leonardo\ProgrammationArduino\libraries\LCD12864R\LCD12864R.cpp:52: error: 'delayMicroseconds' was not declared in this scope
C:\Users\goetschit\Arduino_Leonardo\ProgrammationArduino\libraries\LCD12864R\LCD12864R.cpp: In member function 'void LCD12864R::Initialise()':
C:\Users\goetschit\Arduino_Leonardo\ProgrammationArduino\libraries\LCD12864R\LCD12864R.cpp:92: error: 'OUTPUT' was not declared in this scope
C:\Users\goetschit\Arduino_Leonardo\ProgrammationArduino\libraries\LCD12864R\LCD12864R.cpp:92: error: 'pinMode' was not declared in this scope



Je pense que je dois changer quelque chose dans la source qui est en C mais quoi  et comment ?
Voila l'endroit ou téléchargé la bibliothèque : http://www.dfrobot.com/image/data/DFR0091/LCD12864R.rar

Si jamais je travaille sur un Module graphique SPI DFR0091 rlier a une carte UNO R3 =) !

En espérant que tout est là !
Cordialement, Thibaud.
Logged

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

Bonsoir,

je crois bien que le problème vient du fichier .h de la bibliothèque il y a un problème au niveau du #include <avr/pgmspace.h>, peut-être qu'il ne trouve pas le chemin car il y a plusieurs sous dossier avr. Est ce que c'est ça ? Si oui que faire ?

Bonne soirée, Thibaud.

PS :

 
Quote
//Demo LCD12864 spi
//www.dfrobot.com

#ifndef LCD12864RSPI_h
#define LCD12864RSPI_h
#include <avr/pgmspace.h> // Ici se situe mon problème
#include <inttypes.h>


class LCD12864RSPI {
typedef unsigned char uchar;


public:

LCD12864RSPI();

void Initialise(void);
void delayns(void);

void WriteByte(int dat);
void WriteCommand(int CMD);
void WriteData(int CMD);


void CLEAR(void);
void DisplayString(int X,int Y,uchar *ptr,int dat);
void DisplaySig(int M,int N,int sig);
void DrawFullScreen(uchar *p);
void img1(uchar img[]);
void img2(uchar img[]);

int delaytime;
int DEFAULTTIME;


static const int latchPin = 8;
static const int clockPin = 3;
static const int dataPin = 9;

};
extern LCD12864RSPI LCDA;
#endif

« Last Edit: March 04, 2013, 04:04:07 pm by Nanonnien » Logged

France
Offline Offline
Faraday Member
**
Karma: 55
Posts: 5347
Arduino Hacker
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Bonjour,

Tu travaille en arduino 1.0.x ?

A mon avis la librairie a été fait pour arduino 002x et n'as jamais été mis à jour.
Dans LCD12864R.cpp il doit y avoir un include de WProgram.h à remplacer par Arduino.h.
Logged

Des news, des tuto et plein de bonne chose sur http://skyduino.wordpress.com !

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

Bonjours,

Je travaille en derniere versiom 1.0.3 sauf erreur.

Okay je vais tenter de changer ça ! Je te redit !
Merci.
Logged

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

Super !

Alors c'était presque ce que tu me disais enfaîte la librairie arduino.h n'était pas du tout inclue dans le .h.

Bon maintenant que j'ai ma compilation qui marche et mon écran LCD qui marche j'ai fait un test... mais rien l'écran reste allumer sans rien afficher une idée peut être =) ?

Bonne soirée.
Logged

France
Offline Offline
Faraday Member
**
Karma: 55
Posts: 5347
Arduino Hacker
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Essaye la librairie de mon article smiley-wink
http://skyduino.wordpress.com/2012/05/25/arduino-ecran-lcd12864-dealextreme-pas-chere-et-puissant/
Logged

Des news, des tuto et plein de bonne chose sur http://skyduino.wordpress.com !

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

J'ai rien dit ça marche  smiley-roll-sweat

Mais je m'en vais tout de même te piquer ta bibliothèque  smiley-razz
Logged

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

Quote
HelloWorld.pde: In function 'void draw()':
HelloWorld:90: error: 'u8g' was not declared in this scope
HelloWorld.pde: In function 'void setup()':
HelloWorld:104: error: 'u8g' was not declared in this scope
HelloWorld.pde: In function 'void loop()':
HelloWorld:114: error: 'u8g' was not declared in this scope

Pas taper !

Il y avait plusieurs fichier j'ai téléchargé le U8glib 1.10 (Arduino Environment).

Logged

France
Offline Offline
Faraday Member
**
Karma: 55
Posts: 5347
Arduino Hacker
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

T'as du oublier de copier la déclaration de l'objet "u8g" en haut du code juste âpres l'include smiley-wink
Logged

Des news, des tuto et plein de bonne chose sur http://skyduino.wordpress.com !

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

Hum pas vraiment, je ne sais pas lequelle déclaré entre ceux ci :
Quote
//U8GLIB_ST7920_128X64_1X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   //8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16;
//U8GLIB_ST7920_128X64_4X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16
//U8GLIB_ST7920_128X64_1X u8g(18, 16, 17);   // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
//U8GLIB_ST7920_128X64_4X u8g(18, 16, 17);   // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
//U8GLIB_ST7920_192X32_1X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16
//U8GLIB_ST7920_192X32_4X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16
//U8GLIB_ST7920_192X32_1X u8g(18, 16, 17);   // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
//U8GLIB_ST7920_192X32_4X u8g(18, 16, 17);   // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
//U8GLIB_ST7920_192X32_1X u8g(13, 11, 10);   // SPI Com: SCK = en = 13, MOSI = rw = 11, CS = di = 10
//U8GLIB_ST7920_192X32_4X u8g(10);      // SPI Com: SCK = en = 13, MOSI = rw = 11, CS = di = 10, HW SPI
//U8GLIB_ST7920_202X32_1X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16
//U8GLIB_ST7920_202X32_4X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16
//U8GLIB_ST7920_202X32_1X u8g(18, 16, 17);   // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
//U8GLIB_ST7920_202X32_4X u8g(18, 16, 17);   // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17

pour que ça marche avec : http://www.dfrobot.com/index.php?route=product/product&path=53_130&product_id=372#.UTejIzDr1hw

Je vait tâtonner en attendant ne réponse  smiley.
Logged

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

Okay après déduction avec les branchements que j'ai çA marche avec :
Quote
//U8GLIB_ST7920_128X64_1X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   //8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16;
//U8GLIB_ST7920_128X64_4X u8g(8, 9, 10, 11, 4, 5, 6, 7, 18, 17, 16);   // 8Bit Com: D0..D7: 8,9,10,11,4,5,6,7 en=18, di=17,rw=16

Mais en branchant autrement çA devrait marcher avec :
Quote
//U8GLIB_ST7920_192X32_1X u8g(18, 16, 17);   // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
//U8GLIB_ST7920_192X32_4X u8g(18, 16, 17);   // SPI Com: SCK = en = 18, MOSI = rw = 16, CS = di = 17
Logged

France
Offline Offline
Faraday Member
**
Karma: 55
Posts: 5347
Arduino Hacker
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

C'est simple de savoir quelle déclaration utiliser avec la lib U8G :
U8GLIB _ le nom du contrôleur _ la taille XY en pixels _ le nombre de couleurs (je crois, faudrait que je relise la doc ...)

Ps: il faut enlever le commentaire // sinon ça compilera pas smiley-wink
Logged

Des news, des tuto et plein de bonne chose sur http://skyduino.wordpress.com !

Pages: [1]   Go Up
Jump to: