Электронная панель приборов на Due + 3,2 TFT

Тимур
Тимур аватар
Offline
Зарегистрирован: 30.04.2014

Начал делать панельку для снегохода при программировании наткнулся на проблему Дуе ругается на картики, выдаёт такое сообщение

 Arduino: 1.5.7 (Windows XP), Board: "Arduino Due (Programming Port)"
 
paneldue.ino: In function 'void setup()':
paneldue.ino:83:46: error: no matching function for call to 'UTFT::drawBitmap(int, int, int, int, unsigned int [900], int)'
paneldue.ino:83:46: note: candidates are:
In file included from paneldue.ino:12:0:
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int scale=1);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note:   no known conversion for argument 5 from 'unsigned int [900]' to 'short unsigned int*'
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int, int, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int deg, int rox, int roy);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note:   candidate expects 8 arguments, 6 provided
paneldue.ino:84:46: error: no matching function for call to 'UTFT::drawBitmap(int, int, int, int, unsigned int [900], int)'
paneldue.ino:84:46: note: candidates are:
In file included from paneldue.ino:12:0:
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int scale=1);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note:   no known conversion for argument 5 from 'unsigned int [900]' to 'short unsigned int*'
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int, int, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int deg, int rox, int roy);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note:   candidate expects 8 arguments, 6 provided
paneldue.ino:85:47: error: no matching function for call to 'UTFT::drawBitmap(int, int, int, int, unsigned int [900], int)'
paneldue.ino:85:47: note: candidates are:
In file included from paneldue.ino:12:0:
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int scale=1);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note:   no known conversion for argument 5 from 'unsigned int [900]' to 'short unsigned int*'
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int, int, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int deg, int rox, int roy);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note:   candidate expects 8 arguments, 6 provided
paneldue.ino:86:47: error: no matching function for call to 'UTFT::drawBitmap(int, int, int, int, unsigned int [900], int)'
paneldue.ino:86:47: note: candidates are:
In file included from paneldue.ino:12:0:
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int scale=1);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note:   no known conversion for argument 5 from 'unsigned int [900]' to 'short unsigned int*'
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int, int, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int deg, int rox, int roy);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note:   candidate expects 8 arguments, 6 provided
paneldue.ino:87:49: error: no matching function for call to 'UTFT::drawBitmap(int, int, int, int, unsigned int [900], int)'
paneldue.ino:87:49: note: candidates are:
In file included from paneldue.ino:12:0:
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int scale=1);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note:   no known conversion for argument 5 from 'unsigned int [900]' to 'short unsigned int*'
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int, int, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int deg, int rox, int roy);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note:   candidate expects 8 arguments, 6 provided
paneldue.ino:88:45: error: no matching function for call to 'UTFT::drawBitmap(int, int, int, int, unsigned int [900], int)'
paneldue.ino:88:45: note: candidates are:
In file included from paneldue.ino:12:0:
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int scale=1);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note:   no known conversion for argument 5 from 'unsigned int [900]' to 'short unsigned int*'
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int, int, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int deg, int rox, int roy);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note:   candidate expects 8 arguments, 6 provided
paneldue.ino:89:46: error: no matching function for call to 'UTFT::drawBitmap(int, int, int, int, unsigned int [900], int)'
paneldue.ino:89:46: note: candidates are:
In file included from paneldue.ino:12:0:
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int scale=1);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:228:8: note:   no known conversion for argument 5 from 'unsigned int [900]' to 'short unsigned int*'
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note: void UTFT::drawBitmap(int, int, int, int, short unsigned int*, int, int, int)
   void drawBitmap(int x, int y, int sx, int sy, bitmapdatatype data, int deg, int rox, int roy);
        ^
C:\Documents and Settings\DreamWolf\Мои документы\Arduino\libraries\UTFT/UTFT.h:229:8: note:   candidate expects 8 arguments, 6 provided
 
  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
 
 
если закоментить картинки то всё грузится нормально, на мегу тоже грузится нормально
сама прога
 
001#include <UTFT.h>
002#include <avr/pgmspace.h>
003UTFT myGLCD(SSD1289,38,39,40,41);
004// Declare which fonts we will be using
005extern uint8_t SmallFont[];
006extern uint8_t BigFont[];
007extern uint8_t SevenSegNumFont[];
008 
009extern unsigned int bigtemp[900];
010extern unsigned int temp[900];
011extern unsigned int Park[900];
012extern unsigned int hloff[900];
013extern unsigned int akum2[900];
014extern unsigned int reverse[900];
015extern unsigned int oil[900];
016extern unsigned int fuel[900];
017 
018extern unsigned int br[900];
019 
020int error;
021 
022// taho
023int taho;
024int t;
025int y;
026int x2;
027int y2;
028int x3;
029int y3;
030int r;
031int r2;
032 
033// engine temp
034int engtemp;
035int tt;
036int ttt;
037//fuel level
038int flevel;
039int fl;
040int fll;
041int ffll;
042 
043//brake
044long tb;
045long tp;
046//speed
047int speed;
048int sp;
049 
050void setup()
051{
052  myGLCD.InitLCD();
053  myGLCD.setFont(SmallFont);
054  myGLCD.fillScr(100, 255, 255);
055  myGLCD.setColor(255, 255, 255);
056  myGLCD.drawBitmap (103, 84, 30, 30, temp, 1);
057  myGLCD.drawBitmap (134, 84, 30, 30, Park, 1);
058  myGLCD.drawBitmap (165, 84, 30, 30, hloff, 1);
059  myGLCD.drawBitmap (196, 84, 30, 30, akum2, 1);
060  myGLCD.drawBitmap (227, 84, 30, 30, reverse, 1);
061  myGLCD.drawBitmap (258, 84, 30, 30, oil, 1);
062  myGLCD.drawBitmap (289, 84, 30, 30, fuel, 1);
063   
064  //temp rect
065   
066  myGLCD.setColor(0,38,255);
067  myGLCD.drawRect(103, 224, 132, 234);
068  myGLCD.drawRect(103, 212, 132, 222);
069  myGLCD.drawRect(103, 200, 132, 210);
070  myGLCD.setColor(0, 0, 0);
071  myGLCD.drawRect(103, 188, 132, 198);
072  myGLCD.drawRect(103, 176, 132, 186);
073  myGLCD.drawRect(103, 164, 132, 174);
074  myGLCD.drawRect(103, 152, 132, 162);
075  myGLCD.drawRect(103, 140, 132, 150);
076  myGLCD.setColor(255,0,0);
077  myGLCD.drawRect(103, 128, 132, 138);
078  myGLCD.drawRect(103, 116, 132, 126);
079   
080  //fuel rect
081  
082  myGLCD.drawRect(289, 224, 317, 234);
083  myGLCD.drawRect(289, 212, 317, 222);
084  myGLCD.setColor(0, 0, 0);
085  myGLCD.drawRect(289, 200, 317, 210);
086  myGLCD.drawRect(289, 188, 317, 198);
087  myGLCD.drawRect(289, 176, 317, 186);
088  myGLCD.drawRect(289, 164, 317, 174);
089  myGLCD.drawRect(289, 152, 317, 162);
090  myGLCD.drawRect(289, 140, 317, 150);
091  myGLCD.drawRect(289, 128, 317, 138);
092  myGLCD.drawRect(289, 116, 317, 126);
093   
094   
095   
096  myGLCD.setBackColor(100,255,255);
097   
098  t = 100;
099  tt = 0;
100  engtemp = 0;
101  ttt = 0;
102  flevel=0;
103  fl=0;
104  fll=0;
105  tb=0;
106  tb=0;
107  error=0;
108}
109 
110void loop()
111{
112   
113  myGLCD.setColor(0,0,0);
114 
115  //tahometer
116myGLCD.setFont(SevenSegNumFont);
117  taho = taho + t;
118  if (taho > 9000){
119  taho = 9000;
120  t = -50; }
121  if (taho <0) {
122  t=50;
123   }
124  if(taho <1000) {
125 myGLCD.printNumI(taho/100, 32, 1);
126 myGLCD.print("0", 1, 1);
127  }
128  else myGLCD.printNumI(taho/100, 1, 1);
129   
130  //tahoscale
131   r = map(taho, 0, 9000, 150, 200);
132      
133  // myGLCD.setColor(100,255,255);
134  // myGLCD.drawLine(100,100,x2,y2);
135 x2 = 218 + sin(2*PI*r/200)*200;  
136 y2 = 218 - cos(2*PI*r/200)*200;  
137 //x3 = 100 + sin(2*PI*r/200)*100;
138 //y3 = 100 - cos(2*PI*r/200)*100;
139myGLCD.setColor(150,230,0);
140myGLCD.fillCircle(x2,y2, 15);
141   
142 
143  // engin temp
144  
145   engtemp = engtemp + tt;
146  if (engtemp >= 100){
147   tt = -1;
148 }
149   if (engtemp <= 0){
150    tt= 1;
151  }
152  
153  if (engtemp>=0 & engtemp<=10){
154   myGLCD.setColor(100,255,255);
155   myGLCD.fillRect(104, 233, 131, 225);
156    ttt = engtemp ;
157   myGLCD.setColor(0,38,255);
158   myGLCD.fillRect (103, 234-ttt, 132, 234);
159   
160 }
161     
162  
163 if (engtemp>=10 & engtemp<=20){
164  myGLCD.setColor(100,255,255);
165  myGLCD.fillRect(104, 221, 131, 213);
166   myGLCD.setColor(0,38,255);
167  ttt=(engtemp-10);
168   myGLCD.fillRect(103, 222-ttt, 132, 222);
169    
170   }
171   
172    
173   if (engtemp>=20 & engtemp<=30){
174  myGLCD.setColor(100,255,255);
175  myGLCD.fillRect(104, 209, 131, 201);
176  myGLCD.setColor(0,38,255);
177  ttt=(engtemp-20);
178   myGLCD.fillRect(103, 210-ttt, 132, 210);
179   }
180  
181   if (engtemp>=30 & engtemp<=40){
182    myGLCD.setColor(100,255,255);
183    myGLCD.fillRect(104, 197, 131, 189);
184    myGLCD.setColor(0, 0, 0);
185     ttt=(engtemp-30);
186   myGLCD.fillRect(103, 198-ttt, 132, 198);
187   }
188   
189   if (engtemp>=40 & engtemp<=50){
190    myGLCD.setColor(100,255,255);
191    myGLCD.fillRect(104, 185, 131, 177);
192    myGLCD.setColor(0, 0, 0);
193     ttt=(engtemp-40);
194   myGLCD.fillRect(103, 186-ttt, 132, 186);
195   }
196        
197   if (engtemp>=50 & engtemp<=60){
198   myGLCD.setColor(100,255,255);
199    myGLCD.fillRect(104, 173, 131, 165);
200    myGLCD.setColor(0, 0, 0);
201     ttt=(engtemp-50);
202   myGLCD.fillRect(103, 174-ttt, 132, 174);
203   }
204       
205   if (engtemp>=60 & engtemp<=70){
206    myGLCD.setColor(100,255,255);
207    myGLCD.fillRect(104, 161, 131, 153);
208    myGLCD.setColor(0, 0, 0);
209     ttt=(engtemp-60);
210   myGLCD.fillRect(103, 162-ttt, 132, 162);
211   }
212        
213    if (engtemp>=70 & engtemp<=80){
214    myGLCD.setColor(100,255,255);
215    myGLCD.fillRect(104, 149, 131, 141);
216    myGLCD.setColor(0, 0, 0);
217      ttt=(engtemp-70);
218   myGLCD.fillRect(103, 150-ttt, 132, 150);
219   }
220      
221    if (engtemp>=80 & engtemp<=90){
222    myGLCD.setColor(100,255,255);
223    myGLCD.fillRect(104, 137, 131, 129);
224    ttt=(engtemp-80);
225    myGLCD.setColor(255,0,0);
226   myGLCD.fillRect(103, 138-ttt, 132, 138);
227   }
228   
229      if (engtemp>=90 & engtemp<=100){
230    myGLCD.setColor(100,255,255);
231    myGLCD.fillRect(104, 125, 131, 117);
232    ttt=(engtemp-90);
233    myGLCD.setColor(255,0,0);
234   myGLCD.fillRect(103, 126-ttt, 132, 126);
235   }
236      
237    // high engine temp
238    if (engtemp >=82){
239  // myGLCD.drawBitmap(103, 84, 30, 30, bigtemp);
240   error = 1;
241   }
242   else if (error==1){
243  // myGLCD.drawBitmap(103, 84, 30, 30, temp);
244   error=0;
245    
246   }
247 
248 // Fuel level
249 
250  
251}

 

 
Тимур
Тимур аватар
Offline
Зарегистрирован: 30.04.2014

картинки делал этим конвертером http://www.henningkarlsen.com/electronics/t_imageconverter565.php галочки стояли на .с и чипкит/дуэ, да и просто на ардуину пробывал

Тимур
Тимур аватар
Offline
Зарегистрирован: 30.04.2014

проблема решена

01extern short unsigned int bigtemp[900];
02extern short unsigned int temp[900];
03extern short unsigned int Park[900];
04extern short unsigned int hloff[900];
05extern short unsigned int akum2[900];
06extern short unsigned int reverse[900];
07extern short unsigned int oil[900];
08extern short unsigned int fuel[900];
09 
10extern short unsigned int br[900];