stm32 keil Variablen Ausgabe

Gast #3146674
Lesenswert?

Hallo,
Ich habe ein kleines Problem mit Variablen Ausgabe aufs Display

Es kommt beim Aufruf von LCD_puts(150,170,speed,WHITE,RED);
der Fehler:

error:  #167: argument of type "u8" is incompatible with parameter of 
type "u8 *"


Vielleicht könnt mir einer helfen.
mfg
1
typedef unsigned char  u8;
2
u8 speed = 155;
3

4
//Aufruf
5
LCD_puts(150,170,speed,WHITE,RED); 
6

7

8
//Funktion
9
void LCD_puts(u16 Xpos, u16 Ypos, u8 *s,u16 Color, u16 bkColor)
10
{ 
11
 do
12
  {
13
    
14
    ili9320_PutChar(Xpos,Ypos,*s++,Color,bkColor);    
15
    if(Xpos > 792) 
16
    {
17
      Xpos+=8;
18
    } 
19
    else if (Ypos<464)//304)
20
    {
21
      Xpos=0;
22
      Ypos+=16;
23
    }   
24
    else
25
    {
26
      Xpos=0;
27
      Ypos=0;
28
    }    
29
  }
30
  while (*s!=0);
31
}
Gast #3147612
Lesenswert?

>> error:  #167: argument of type "u8" is incompatible with parameter of
>> type "u8 *"

> speed ist kein String sondern eine Zahl.
> Mach aus speed einen String und übergib den.

u8 speed = 155;  --> u8 *speed ="155";
Gast #3147678
Lesenswert?

So jetz Gehts.
Aber ich bekomm bei sprintf( speedshowBuffer, "%3d  ", speedchan[speed] 
);
folgende Warnung:

warning:  #167-D: argument of type "u8 *" is incompatible with parameter 
of type "char *restrict"
1
u8 speed = 155;
2
u8 speedchan[400];
3
u8 speedchan[speed];
4
u8 speedshowBuffer[50];
5

6
  sprintf( speedshowBuffer, "%3d  ", speedchan[speed] );
7
//Aufruf
8
LCD_puts(150,170,speedshowBuffer,WHITE,RED);

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren