Pages: [1]   Go Down
Author Topic: Arduino et problemes Shields  (Read 865 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

Bonjour,

j'ai récemment acheter une arduino UNO ( http://www.lextronic.fr/P4124-platine-arduino-uno-rev-3.html ) et a celle-ci j'y est joins 2 shield : 1 afficheur 4 display shield 144 ( http://www.lextronic.fr/P19838-platine-4display-shield-144.html ) et un MP3 player shield ( http://www.lextronic.fr/P19422-platine-mp3-shield-pour-arduino.html ) , mais malgré mes nombreuse recherche je n'ai rien trouver pour m'expliquer comment m'en servir avec ma arduino .
Si vous pourriez m'éviter de me renvoyer sur des site anglais , ou des site ne m'expliquant rien de compréhensible , Merci
Logged

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

Bonjour,

Pour l'écran lcd il existe une librairie tout préte (site en anglais ... en francais ya rien) :
http://code.google.com/p/displayshield4d/

Qui fourni les fonctions suivante :
Code:
uint8_t Init(); // initialise l'écran lcd
uint8_t Reset(); // réinitialise l'écran lcd
uint8_t Clear(); // efface l'écran lcd

unsigned int RGB(uint8_t red, uint8_t green, uint8_t blue); // retourne un couleur à partir des composantes RGB passé en arguments
uint8_t SetPenSize(char val); // Défini la taille du stylo de dessin
uint8_t SetBackground(unsigned int color); // Défini la couleur d'arrière plan
uint8_t SetContrast(char val); // Change la valeur du contraste

uint8_t putpixel(uint8_t x, uint8_t y, unsigned int color); // Dessine un pixel de couleur "color" aux coordonnées (x, y)
uint16_t readpixel(uint8_t x, uint8_t y); // Lit la couleur du pixel aux coordonnées (x, y)
uint8_t line(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, unsigned int color); // Dessine une ligne de couleur "color" du point (x1, y1) au point (x2, y2)
uint8_t rectangle(uint8_t x, uint8_t y, uint8_t width, uint8_t height, char filled, unsigned int color); // Dessine un rectangle de couleur "color" plein (filled -> true) ou vide (filled -> false) du point (x, y) avec une hauteur de "height" sur une longueur de "width" pixels
uint8_t circle(uint8_t x, uint8_t y, uint8_t radius, uint8_t filled, unsigned int color); // Dessine un cercle avec comme centre le point (x, y) de rayon "radius" et de couleur "color", plein (filled -> true) ou vide (filled -> false)
uint8_t triangle(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t x3, uint8_t y3, uint8_t filled, unsigned int color); // Dessineun triangle entre les points de coordonnées (x1, y1)(x2, y2) et (x3, y3) de couleur "color", plein (filled -> true) ou vide (filled -> false)

uint8_t drawstringblock(uint8_t x, uint8_t y, uint8_t font, unsigned int color, uint8_t width, uint8_t height, char *text); // Affiche le texte "text", à partir du pixel (x, y) avec la police "font" de couleur "color" et de taille width x height
uint8_t drawasciichar(uint8_t strChar, uint8_t x, uint8_t y, unsigned int color, uint8_t width, uint8_t height); // Affiche un caractére "strChr" à partir du pixel (x, y) de couleur "color" et de taille width x height

Pour "lire" le joystick il faut utiliser analogRead(A0) en fonction du bouton appuyé la valeur sera différente (mais je ne connait pas ces valeurs, perso j'ai juste l'écran, pas la version shield).

Pour la shield mp3, sparkfun fourni un code d'exemple : http://www.sparkfun.com/products/10628 (voir en bas de la description) mais comme toujours il n'existe aucun tutoriels en français ...
Logged

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

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

Merci , mais comment dois-je utiliser cette librairie , comment l’intégrer dans mon programme ?

Le logiciel m’écrit :

displayshield4d.cpp:25:22: error: WProgram.h: No such file or directory
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::Init()':
displayshield4d.cpp:45: error: 'OUTPUT' was not declared in this scope
displayshield4d.cpp:45: error: 'pinMode' was not declared in this scope
displayshield4d.cpp:47: error: 'delay' was not declared in this scope
displayshield4d.cpp:48: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::Reset()':
displayshield4d.cpp:117: error: 'LOW' was not declared in this scope
displayshield4d.cpp:117: error: 'digitalWrite' was not declared in this scope
displayshield4d.cpp:118: error: 'delay' was not declared in this scope
displayshield4d.cpp:119: error: 'HIGH' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::Clear()':
displayshield4d.cpp:132: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::GetReply()':
displayshield4d.cpp:146: error: 'byte' was not declared in this scope
displayshield4d.cpp:146: error: expected `;' before 'incomingByte'
displayshield4d.cpp:147: error: 'Serial' was not declared in this scope
displayshield4d.cpp:147: error: 'delayMicroseconds' was not declared in this scope
displayshield4d.cpp:148: error: 'incomingByte' was not declared in this scope
displayshield4d.cpp:148: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::SetPenSize(char)':
displayshield4d.cpp:183: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::SetBackground(unsigned int)':
displayshield4d.cpp:200: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::SetContrast(char)':
displayshield4d.cpp:220: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::SetState(char)':
displayshield4d.cpp:239: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::Sleep(char)':
displayshield4d.cpp:258: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::ScreenCopy(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)':
displayshield4d.cpp:278: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::putpixel(uint8_t, uint8_t, unsigned int)':
displayshield4d.cpp:302: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint16_t DisplayShield4d::readpixel(uint8_t, uint8_t)':
displayshield4d.cpp:323: error: 'Serial' was not declared in this scope
displayshield4d.cpp:327: error: 'delayMicroseconds' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::line(uint8_t, uint8_t, uint8_t, uint8_t, unsigned int)':
displayshield4d.cpp:344: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::rectangle(uint8_t, uint8_t, uint8_t, uint8_t, char, unsigned int)':
displayshield4d.cpp:374: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::circle(uint8_t, uint8_t, uint8_t, uint8_t, unsigned int)':
displayshield4d.cpp:403: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::triangle(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, uint8_t, unsigned int)':
displayshield4d.cpp:432: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::setfont(uint8_t)':
displayshield4d.cpp:461: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::setfontmode(uint8_t)':
displayshield4d.cpp:479: error: 'Serial' was not declared in this scope
displayshield4d.cpp: In member function 'uint8_t DisplayShield4d::drawstringblock(uint8_t, uint8_t, uint8_t, unsigned int, uint8_t, uint8_t, char*)':
displayshield4d.cpp:498: error: 'Serial' was not declared in this scope
Logged

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

Je suppose que tu est sous arduino 1.0 ?
Utilise arduino 0023 tu verra il n'y aura plus d'erreur de compilation smiley-wink
Logged

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

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

Oui , effectivement , Mais je ne sais pas ou trouver cette version , et j'ai telecharger la version qui ce trouve sur le site , pourquoi cela ne marche pas avec cette version ?
je vous remercie
Logged

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

Oui , effectivement , Mais je ne sais pas ou trouver cette version , et j'ai telecharger la version qui ce trouve sur le site , pourquoi cela ne marche pas avec cette version ?
je vous remercie
La version 0023 est dispo sur la page de téléchargement officiel dans la partie "Previous IDE Versions".

Pour faire simple la version 1.0 a instauré des changements importants dans les fonctions "arduino" ce qui rend incompatible toute les librairies créer avant arduino 1.0.
Je ne vais pas refaire tout le détail du pourquoi, ça as déja fait l'objet de plusieurs topic smiley-wink
Logged

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

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

Je vous remercie de votre aide , qui m'a étais précieuse ; tous fonctionne , je vais pouvoir enfin jouir de mes achats !
Logged

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

lorsque je compile le programme d'exemple de la platine MP3 : tous fonctionne , mais lorsque je lance la lecture :
le terminal écrit :

MP3 Testing
Error: Card init
Error: Volume ini
Error: Opening root
SCI_Mode (0x4800) = 0x4800
SCI_Status (0x48) = 0x48
VS Version (VS1053 is 4) = 4
SCI_ClockF = 0x0
SCI_ClockF = 0x6000
Failed to open track001.mp3
Failed to open track002.mp3
Failed to open track003.mp3
Failed to open track004.mp3
Failed to open track005.mp3
Failed to open track006.mp3
Failed to open track007.mp3
Failed to open track008.mp3
Failed to open track009.mp3
Failed to open track010.mp3
Failed to open track011.mp3
Failed to open track012.mp3
Failed to open track013.mp3
Failed to open track014.mp3
Failed to open track015.mp3
Failed to open track016.mp3
Failed to open track017.mp3
Failed to open track018.mp3
Failed to open track019.mp3
Failed to open track020.mp3
Failed to open track021.mp3
Failed to open track022.mp3
Failed to open track023.mp3
Failed to open track024.mp3
Failed to open track025.mp3
Failed to open track026.mp3
Failed to open track027.mp3
Failed to open track028.mp3
Failed to open track029.mp3
Failed to open track030.mp3
Failed to open track031.mp3
Failed to open track032.mp3
Failed to open track033.mp3
Failed to open track034.mp3
Failed to open track035.mp3
Failed to open track036.mp3
Failed to open track037.mp3
Failed to open track038.mp3
Failed to open track039.mp3
Failed to open track040.mp3
Failed to open track041.mp3
Failed to open track042.mp3
Failed to open track043.mp3
Failed to open track044.mp3
Failed to open track045.mp3
Failed to open track046.mp3
Failed to open track047.mp3
Failed to open track048.mp3
Failed to open track049.mp3
Failed to open track050.mp3
Failed to open track051.mp3
Failed to open track052.mp3
Failed to open track053.mp3
Failed to open track054.mp3
Failed to open track055.mp3
Failed to open track056.mp3
Failed to open track057.mp3
Failed to open track058.mp3
Failed to open track059.mp3
Failed to open track060.mp3
Failed to open track061.mp3
Failed to open track062.mp3
Failed to open track063.mp3
Failed to open track064.mp3
Failed to open track065.mp3
Failed to open track066.mp3
Failed to open track067.mp3
Failed to open track068.mp3
Failed to open track069.mp3
Failed to open track070.mp3
Failed to open track071.mp3
Failed to open track072.mp3
Failed to open track073.mp3
Failed to open track074.mp3
Failed to open track075.mp3
Failed to open track076.mp3
Failed to open track077.mp3
Failed to open track078.mp3
Failed to open track079.mp3
Failed to open track080.mp3
Failed to open track081.mp3
Failed to open track082.mp3
Failed to open track083.mp3
Failed to open track084.mp3
Failed to open track085.mp3
Failed to open track086.mp3
Failed to open track087.mp3
Failed to open track088.mp3
Failed to open track089.mp3
Failed to open track090.mp3
Failed to open track091.mp3
Failed to open track092.mp3
Failed to open track093.mp3
Failed to open track094.mp3
Failed to open track095.mp3
Failed to open track096.mp3
Failed to open track097.mp3
Failed to open track098.mp3
Failed to open track099.mp3
Failed to open track100.mp3
Whoa there cowboy!
Logged

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

MP3 Testing
Error: Card init
Error: Volume ini
Error: Opening root
Apparemment il ya eu un probléme lors de l'initialisation de la carte SD.
Est ce qu'elle est bien inséré ? Si oui est elle bien formaté en FAT ?
Si possible faire un test avec une carte SD de taille <2Go pour voir.
Logged

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

Pages: [1]   Go Up
Jump to: