Code: Select all
TFT_Write_Text('V:'+Vtxt, 80, 100);
TFT_Set_Font(@Arial42x51_Bold, CL_BLUE, FO_HORIZONTAL);
TFT_Write_Text('V:'+Vtxt, 80, 100);
Code: Select all
TFT_Write_Text('V:'+Vtxt, 80, 100);
TFT_Set_Font(@Arial42x51_Bold, CL_BLUE, FO_HORIZONTAL);
TFT_Write_Text('V:'+Vtxt, 80, 100);
If so then there is nothing
Code: Select all
TFT_Set_Font(@Arial42x51_Bold, CL_BLUE, FO_HORIZONTAL);
TFT_Write_Text('V:'+Vtxt, 80, 100);
Code: Select all
VoltLabel1_Caption:=Vtxt;
DrawLabel(@VoltLabel1);
Code: Select all
//-------------------------------------------------------------------
void TFT9341_DrawChar(uint16_t x, uint16_t y, uint8_t c)
{
uint32_t i = 0, j = 0;
uint16_t height, width;
uint8_t offset;
uint8_t *c_t;
uint8_t *pchar;
uint32_t line=0;
height = lcdprop.pFont->Height;
width = lcdprop.pFont->Width;
offset = 8 *((width + 7)/8) - width ;
c_t = (uint8_t*) &(lcdprop.pFont->table[(c-' ') * lcdprop.pFont->Height * ((lcdprop.pFont->Width + 7) / 8)]);
for(i = 0; i < height; i++)
{
pchar = ((uint8_t *)c_t + (width + 7)/8 * i);
switch(((width + 7)/8))
{
case 1:
line = pchar[0];
break;
case 2:
line = (pchar[0]<< 8) | pchar[1];
break;
case 3:
default:
line = (pchar[0]<< 16) | (pchar[1]<< 8) | pchar[2];
break;
}
for (j = 0; j < width; j++)
{
if(line & (1 << (width- j + offset- 1)))
{
TFT9341_DrawPixel((x + j), y, lcdprop.TextColor);
}
else
{
TFT9341_DrawPixel((x + j), y, lcdprop.BackColor);
}
}
y++;
}
}
//-------------------------------------------------------------------
void TFT9341_String(uint16_t x,uint16_t y, char *str)
{
while(*str)
{
TFT9341_DrawChar(x,y,str[0]);
x+=lcdprop.pFont->Width;
(void)*str++;
}
}
void TFT9341_DrawPixel(int x, int y, uint16_t color)
{
if((x<0)||(y<0)||(x>=TFT9341_WIDTH)||(y>=TFT9341_HEIGHT)) return;
TFT9341_SetAddrWindow(x,y,x,y);
TFT9341_SendCommand(0x2C);
TFT9341_SendData(color>>8);
TFT9341_SendData(color & 0xFF);
}
//------------------------------------------------------------------
Code: Select all
ADC_V := ADC1_Get_Sample (0);
Ref := 3.305 / 4095;
V := (Real(ADC_V) * Real(Ref)) * 11;
FloatToStr(V, Vtxt);
Vtxt[4]:= 0;
VoltLabel1_Caption:= Vtxt;
VoltLabel1.Font_Color:=CL_WHITE;
DrawLabel(@VoltLabel1);
VoltLabel1.Font_Color:=CL_BLUE;
DrawLabel(@VoltLabel1);
Code: Select all
VoltLabel1_Caption:= Vtxt;
VoltLabel1.Font_Color:=CL_WHITE;
DrawLabel(@VoltLabel1);
VoltLabel1.Font_Color:=CL_BLUE;
DrawLabel(@VoltLabel1);