Beispiel #1
0
int main(void)
{
	GPIO_Configuration();
    InitLCD();
	RCC_Configuration();
	uint8_t Pos=60;
    while (1)
    {
    	/*ClrScr();
    	Pos+=1;
    	DrawRectangle(Pos,Pos,242-2*Pos,130-2*Pos,clBlack);
    	DrawRectangle(Pos-20,Pos-20,242-2*(Pos-20),130-2*(Pos-20),clBlack);
    	DrawRectangle(Pos-40,Pos-40,242-2*(Pos-40),130-2*(Pos-40),clBlack);
    	ShowForm(165,5,70,80);
    	DrawRectangle(1,1,240,128,clBlack);
    	RefreshLCD();
    	if (Pos==64) {Pos=44;};*/
    	DrawFillRectangle(1,1,240,128,clWhite);
    	RefreshLCD();
    	Delay(500);
    	DrawFillRectangle(1,1,240,128,clBlack);
    	RefreshLCD();
    	Delay(500);
    }
}
Beispiel #2
0
void DrawRectangle(char XRect2,char YRect2,char WidthRect2,char HeightRect2,unsigned long ColorRect2,char WidthLine)
{
  DrawFillRectangle(XRect2,YRect2,WidthRect2,WidthLine,ColorRect2);
  DrawFillRectangle(XRect2+WidthRect2-WidthLine,YRect2,WidthLine,HeightRect2,ColorRect2);
  DrawFillRectangle(XRect2,YRect2+HeightRect2-WidthLine,WidthRect2,WidthLine,ColorRect2);
  DrawFillRectangle(XRect2,YRect2,WidthLine,HeightRect2,ColorRect2);
}
Beispiel #3
0
void DrawScreen( void ) {
	u8 fontWidth;
	ClearScr();
	
	DrawFillRectangle( 0,57, 128, 64, LCD_PIXEL_ON);
	DrawText(1,58, "GPS v0.1 - joaquim.org", LCD_CHAR_INV);
}
Beispiel #4
0
int main(void) {
    if (SysTick_Config(SystemCoreClock / 1000)) {
        while (1) {};
    }
    Init_GPIO();
    Init_SPI();
    Init_RNG();
    Init_LCD();

    int counter=1;
    int counter2 =0;
    int x = 0;
    int y = 0;
    DrawFillRectangle(1,1,128,160,0xFFFFFF);
    for ( x = 160; x > 0; x-- )
        for ( y = 1; y <= 84; y++ )
            DrawFillRectangle(y+22, x, 1, 1, Image[(y-1)*160+161-x]-0x010101);
    while(1) {


        //DrawFillRectangle(RNG->DR%128,RNG->DR%160,RNG->DR%128,RNG->DR%160,RNG->DR);
        /*if ( counter2 == 60000 ) {
            DrawFillRectangle(counter-1, counter-1, 20, 20, 0x000000);
            DrawFillRectangle(counter, counter, 20, 20, RNG->DR);
            //DrawFillRectangle(1,1,128,160,0x00000);
            counter+=1;
            counter2=0;
        }
        counter2+=1;
        if ( counter == 108 ) {
            DrawFillRectangle(1,1,128,160,0x00000);
            counter = 0;
        }*/
        /*GPIOD->ODR^=GreenLed;
        Delay(1);
        GPIOD->ODR^=OrangeLed;
        Delay(1);
        GPIOD->ODR^=RedLed;
        Delay(1);
        GPIOD->ODR^=BlueLed;
        Delay(1);*/
    }
    return 0;
}
Beispiel #5
0
//----------------------------
void main()      
{ 
  char ru;
  InitSystemClock();
  InitPortsIO();   
  InitSPI();
  //InitTimers();
  //EnableInterrupts(); 
  InitLCD();
  DrawFillRectangle(1,1,130,130,0x000000);//Background
  ru=PIND;
  //DrawText(1,1,"Hello /@",1);
  for (char i=1;i<=255;i+=2) {
   DrawFillRectangle(1,i/2,130,1,i);   
  };
  while (1)   
  {   
    
  }   
} 
Beispiel #6
0
void DrawGPSData( void ) {
	int tmp,barrapos,sinal,x,y;
	u8 str_buffer[0x10];
	float valor;
	gps_data_t local_gps_data;
	
	
	get_gps_data(&local_gps_data);
	
	valor = local_gps_data.pos.lat;
	sprintf(str_buffer, "%03.6f", valor);
	GotoXY( 0, 0 );
	PutText("LAT : ", LCD_PIXEL_ON);
	PutText(str_buffer, LCD_PIXEL_ON);

	valor = local_gps_data.pos.lon;
	sprintf(str_buffer, "%03.6f", valor);	
	GotoXY( 0, 6 );
	PutText("LON : ", LCD_PIXEL_ON);
	PutText(str_buffer, LCD_PIXEL_ON);
	
	valor = local_gps_data.pos.alt;
	sprintf(str_buffer, "%04.1f", valor);	
	GotoXY( 0, 12 );
	PutText("ALT : ", LCD_PIXEL_ON);
	PutText(str_buffer, LCD_PIXEL_ON);
	/*
	valor = local_gps_data.status.siu;
	sprintf(str_buffer, "%d", (int)valor);	
	GotoXY( 70, 0 );
	PutText("SAT : ", LCD_PIXEL_ON);
	PutText(str_buffer, LCD_PIXEL_ON);
	
	valor = local_gps_data.pos.cor;
	sprintf(str_buffer, "%d", (int)valor);	
	GotoXY( 70, 6 );
	PutText("CUR : ", LCD_PIXEL_ON);
	PutText(str_buffer, LCD_PIXEL_ON);
	
	valor = local_gps_data.pos.spd;
	sprintf(str_buffer, "%d", (int)valor);	
	GotoXY( 70, 12 );
	PutText("SPE : ", LCD_PIXEL_ON);
	PutText(str_buffer, LCD_PIXEL_ON);
	*/
	
	GotoXY( 0, 51 );	
	PutText(local_gps_data.datetime.date, LCD_PIXEL_ON);
	PutText("   ", LCD_PIXEL_ON);
	PutText(local_gps_data.datetime.time, LCD_PIXEL_ON);	
	
	DrawCircle( 95,30,30, LCD_PIXEL_ON );
	DrawCircle( 95,30,20, LCD_PIXEL_ON );
	DrawCircle( 95,30,10, LCD_PIXEL_ON );
	DrawCircle( 95,30,1, LCD_PIXEL_ON );
	barrapos = 2;
	for(tmp = 0; tmp < 12; tmp++) {
		valor = local_gps_data.sat_inview[tmp].snr;		
		sinal = (int)valor / 5;
		DrawRectangle( barrapos - 1,27, barrapos + 1, 49, LCD_PIXEL_ON);
		DrawFillRectangle( barrapos - 1,49 - sinal, barrapos + 1, 49, LCD_PIXEL_ON); 
		barrapos += 5;
		if ( valor > 0) {
			x = 95 + (30 - local_gps_data.sat_inview[tmp].ele / 3 ) * cos(local_gps_data.sat_inview[tmp].azi);
			y = 30 + (30 - local_gps_data.sat_inview[tmp].ele / 3 ) * sin(local_gps_data.sat_inview[tmp].azi);
			DrawCircle( x,y,3, LCD_PIXEL_ON );
			DrawCircle( x,y,2, LCD_PIXEL_ON );
			DrawCircle( x,y,1, LCD_PIXEL_ON );
			DrawPoint( x,y, LCD_PIXEL_ON );
			GotoXY( x - 1, y - 2 );
			sprintf(str_buffer, "%01d", (int)tmp);
			PutText(str_buffer, LCD_PIXEL_OFF);
		}
	}
	
}
Beispiel #7
0
void DrawPoint(char XPoint,char YPoint,unsigned long ColorPoint)
{
  DrawFillRectangle(XPoint,YPoint,1,1,ColorPoint);  
}