void handling_digits(char *tstr)
{
	if (mode == 2) {
		LCD_SetTextColor(Black);
		LCD_SetBackColor(Black);
		LCD_DrawFullRect(140, 80, 110, 56);
	}
	else {
		WPrint(&MyWatchScr[SEP1STR], ":");
		WPrint(&MyWatchScr[SEP2STR], ":");
		if (mode == 1 ) {
			LCD_SetTextColor(Black);
			LCD_SetBackColor(Black);
			LCD_DrawFullRect(210, 80, 40, 56);
			drawdigits(tstr,&MyWatchScr[SECSTR], 0, 150, 80);
		}
		if (mode == 3) {
			drawdigits(tstr,&MyWatchScr[SECSTR], 0, 150, 80);
			tenths2digit(tstr, 0);
			LCD_SetTextColor(Black);
			LCD_SetBackColor(Black);
			LCD_DrawFullRect(208, 80, 35, 48);
			WPrint(&MyWatchScr[DOT], ".");
			WPrint(&MyWatchScr[TTSSTR], tstr);
		}
		if (mode == 0) {
			LCD_SetTextColor(Black);
			LCD_SetBackColor(Black);
			LCD_DrawFullRect(210, 80, 40, 56);
		}
	}
}
Exemple #2
0
void HID_MOUSE_ButtonPressed(uint8_t button_idx)
{
  
  /* Set the color for button press status */
  LCD_SetTextColor(LCD_COLOR_GREEN);
  LCD_SetBackColor(LCD_COLOR_GREEN);
  
  /* Change the color of button pressed to indicate button press*/
  switch (button_idx)
  {
    /* Left Button Pressed */
  case 0 :
    LCD_DrawFullRect(HID_MOUSE_BUTTON_XCHORD, HID_MOUSE_BUTTON1_YCHORD,\
    HID_MOUSE_BUTTON_WIDTH, HID_MOUSE_BUTTON_HEIGHT );
    break;
    
    
    /* Right Button Pressed */  
  case 1 :
    LCD_DrawFullRect(HID_MOUSE_BUTTON_XCHORD,HID_MOUSE_BUTTON2_YCHORD,\
       HID_MOUSE_BUTTON_WIDTH,HID_MOUSE_BUTTON_HEIGHT);
    break; 
    
    /* Middle button Pressed */  
  case 2 :
    LCD_DrawFullRect(HID_MOUSE_BUTTON_XCHORD,HID_MOUSE_BUTTON3_YCHORD,\
      HID_MOUSE_BUTTON_WIDTH,HID_MOUSE_BUTTON_HEIGHT);
    break;
    
  }
}
Exemple #3
0
void ui_draw_button()
{
    LCD_SetColors(LCD_COLOR_BLACK , LCD_COLOR_BLACK);
    LCD_DrawFullRect(70     , 55     , 40, 40);
    LCD_DrawFullRect(70 + 60, 55     , 40, 40);
    LCD_DrawFullRect(70     , 55 + 75, 40, 40);
    LCD_DrawFullRect(70 + 60, 55 + 75, 40, 40);

    LCD_SetColors(LCD_COLOR_YELLOW , LCD_COLOR_YELLOW);
    //BPM minus
    LCD_DrawFullRect(70 + 5 , 55 + 15, 30, 10);

    //BPM plus
    LCD_DrawFullRect(70 + 65, 55 + 15, 30, 10);
    LCD_DrawFullRect(70 + 75, 55 + 5 , 10, 30);

    //BEAT minus
    LCD_DrawFullRect(70 + 5 , 55 + 90, 30, 10);

    //BEAT plus
    LCD_DrawFullRect(70 + 65, 55 + 90, 30, 10);
    LCD_DrawFullRect(70 + 75, 55 + 80, 10, 30);

    //start/stop button
    LCD_SetColors(LCD_COLOR_BLUE, LCD_COLOR_BLUE);
    LCD_DrawFullCircle(40, 280, 20);
    LCD_SetColors(LCD_COLOR_CYAN, LCD_COLOR_CYAN);
    LCD_DrawFullCircle(40, 280,15 );
}
Exemple #4
0
void HID_MOUSE_ButtonReleased(uint8_t button_idx)
{
  
  /* Set the color for release status */
  LCD_SetTextColor(LCD_COLOR_WHITE);
  LCD_SetBackColor(LCD_COLOR_WHITE);
  
  /* Change the color of button released to default button color*/
  switch (button_idx)
  {
    
    /* Left Button Released */
  case 0 :
    LCD_DrawFullRect(HID_MOUSE_BUTTON_XCHORD, HID_MOUSE_BUTTON1_YCHORD,\
       HID_MOUSE_BUTTON_WIDTH, HID_MOUSE_BUTTON_HEIGHT);
    break;
    
    /* Right Button Released */  
  case 1 :
    LCD_DrawFullRect(HID_MOUSE_BUTTON_XCHORD, HID_MOUSE_BUTTON2_YCHORD,\
       HID_MOUSE_BUTTON_WIDTH, HID_MOUSE_BUTTON_HEIGHT);
    break;
    
    /* Middle Button Released */  
  case 2 :
    LCD_DrawFullRect (HID_MOUSE_BUTTON_XCHORD, HID_MOUSE_BUTTON3_YCHORD,\
       HID_MOUSE_BUTTON_WIDTH, HID_MOUSE_BUTTON_HEIGHT);
    break;
  }
}
uint8_t arrow_function(void){


	uint8_t   ascii_code=0;			// Variável para receber valor ascii
	static uint8_t   menu=0;			// Variável para definir qual a escolhas será feita no menu
	ascii_code=GetKey();        // GetKey retorna valor ascii apenas 1 vez quando tem algum novo

	if (ascii_code==6){
		menu=1;
		LCD_DrawFullRect(0, 0, 240, 320, LCD_COLOR_BLACK);	//Imprime retângulo branco do tamanha da tela(apaga tudo)
		LCD_DrawFullRect(35, 60, 170, 80, aktColor);
		imprimir_menu();
	}
	if (ascii_code==7){
		menu=2;
		LCD_DrawFullRect(0, 0, 240, 320, LCD_COLOR_BLACK);	//Imprime retângulo branco do tamanha da tela(apaga tudo)
		LCD_DrawFullRect(35, 190, 170, 80, aktColor);
		imprimir_menu();
	}

	if (ascii_code==4)
	return(menu);
	else
	return(0);
}
Exemple #6
0
	void
GAME_Render()
{
	LCD_SetTextColor( LCD_COLOR_WHITE );
	LCD_DrawFullRect( player1X, player1Y, player1W, player1H );
	LCD_DrawFullRect( player2X, player2Y, player2W, player2H );
	LCD_DrawFullRect( ballX, ballY, ballSize, ballSize );
	LCD_DrawLine( 10, LCD_PIXEL_HEIGHT / 2, LCD_PIXEL_WIDTH - 20, LCD_DIR_HORIZONTAL );
}
Exemple #7
0
/**
* @brief  Mems gyroscope Demo application.
* @param  None
* @retval None
*/
static void Demo_MEMS(void)
{   
  
  /* Read Gyro Angular data */
  Demo_GyroReadAngRate(Buffer);

  Buffer[0] = (int8_t)Buffer[0] - (int8_t)Gyro[0];
  Buffer[1] = (int8_t)Buffer[1] - (int8_t)Gyro[1];
  
  /* Update autoreload and capture compare registers value*/
  Xval = ABS((int8_t)(Buffer[0]));
  Yval = ABS((int8_t)(Buffer[1])); 
  
  if ( Xval>Yval)
  {
    if ((int16_t)Buffer[0] > 40)
    {
      /* Clear the LCD */
      LCD_Clear(LCD_COLOR_WHITE);
      LCD_SetTextColor(LCD_COLOR_MAGENTA);
      LCD_DrawFullRect(100, 40, 40, 120);
      LCD_FillTriangle(50, 190, 120, 160, 160, 310);
      Delay(50);
    }
    if ((int16_t)Buffer[0] < -40)
    {
      /* Clear the LCD */
      LCD_Clear(LCD_COLOR_WHITE);
      LCD_SetTextColor(LCD_COLOR_RED);
      LCD_DrawFullRect(100, 160, 40, 120);
      LCD_FillTriangle(50, 190, 120, 160, 160, 10);
      Delay(50);
    }
  }
  else
  {
    if ((int16_t)Buffer[1] < -40)
    {
      /* Clear the LCD */
      LCD_Clear(LCD_COLOR_WHITE);
      LCD_SetTextColor(LCD_COLOR_GREEN);
      LCD_DrawFullRect(120, 140, 100, 40);
      LCD_FillTriangle(120, 120, 5, 60, 260, 160);      
      Delay(50);
    }
    if ((int16_t)Buffer[1] > 40)
    {      
      /* Clear the LCD */ 
      LCD_Clear(LCD_COLOR_WHITE);
      LCD_SetTextColor(LCD_COLOR_BLUE);
      LCD_DrawFullRect(20, 140, 100, 40);
      LCD_FillTriangle(120, 120, 235, 60, 260, 160);
      Delay(50);
    } 
  } 
}
Exemple #8
0
void password_screen(){

	//fond d'écran, header, footer
	create_rectangle(0,0,320,240,0x632C);
	header(5,TRUE,TRUE);

	//initialisatioin des variables
	char * temp[20],hidden[20]={};
	uint32_t i,j,len = strlen(password);
	uint32_t plus = 0, offsetY = 85, offsetX = 10;

	//création de la barre de texte
	LCD_DrawFullRect(10,40,300,32,0x39C7,0xD6BA);
	LCD_DrawFullRect(279,41,30,30,0xD6BA,0x153F);
	create_button(button,41,279,41,30,30);

	//on affiche le mot de passe en masuqnat les caractères
	for(i = 0; i<len;i++){
		strcpy(temp,hidden);
		sprintf(hidden,"%s-",(uint8_t *)temp);
	}
	LCD_DisplayStringLine(52,15,(uint8_t *)hidden,0x39C7,0xD6BA,LCD_NO_DISPLAY_ON_UART);

	//on choisit la police du texte à afficher
	LCD_SetFont(&Bebasn);

	//affichage des icônes dans le menu
	for(i=0;i<4;i++){
		for(j=0;j<10;j++){

			//bufferisation de la position des boutons
			create_button(button,plus,(30*j)+offsetX,(31*i)+offsetY,30,30);

			//drawing separators
			LCD_DrawRect((30*j)+offsetX,(31*i)+offsetY,30,30,0x39C7);
			LCD_DrawFullRect((30*j)+offsetX,(31*i)+offsetY,29,29,0x738E,0x5ACB);
			LCD_DisplayStringLine((31*i)+offsetY+11,(30*j)+offsetX+11,(uint8_t *)string[plus],0xD6BA,0x5ACB,LCD_NO_DISPLAY_ON_UART);
			plus++;

			// on sort de la boucle pour ne pas afficher les deux dernières touches du clavier
			// (choix graphique, on aurait pu faire sans)
			if (plus > 37){
				j = 10;
				i = 4;
			}

		}
	}

	//affichage du footer, puis lecture de l'écran tactile
	footer(PASSWORD);
	read_screen(button,PASSWORD,40);

}
/**
  * @brief  Display Init (LCD)
  * @param  None
  * @retval None
  */
static void Display_Init(void)
{
  /* Initialize the LCD */
#ifdef USE_STM320518_EVAL
    STM320518_LCD_Init();
#else
    STM32072B_LCD_Init();
#endif /* USE_STM320518_EVAL */

  /* Clear the LCD */
  LCD_Clear(LCD_COLOR_WHITE);
  
  /* Set the LCD Back Color */
  LCD_SetBackColor(Blue);
  
  /* Set the LCD Text Color */
  LCD_SetTextColor(White);
  
  /* Displays MESSAGE1 on line 1 */
  LCD_DisplayStringLine(LINE(0), (uint8_t *)MESSAGE1);
  
  /* Set the LCD Text Color */
  LCD_SetTextColor(Red);
  
  /* Set the LCD Back Color */
  LCD_SetBackColor(Red);
  LCD_DrawFullRect(31, 292,264,34);
  
  /* Set the LCD Back Color */
  LCD_SetBackColor(White);
  LCD_DrawFullRect(33, 290 ,260,30);
  
  
  /* Set the LCD Text, Back Colors and Text size */
  LCD_SetTextColor(Black); 
  LCD_SetBackColor(Cyan);
  LCD_SetFont(&Font12x12);
  
  LCD_DisplayStringLine(LINE(18), (uint8_t *)MESSAGE2);
  
  /* Set the LCD Back Color */
  LCD_SetBackColor(Blue);
  LCD_SetTextColor(White);
  
  LCD_DisplayStringLine(LINE(19), (uint8_t *)MESSAGE3);
  
  /* Set text size */
  LCD_SetFont(&Font16x24);
  
  /* Set the LCD Text Color */
  LCD_SetTextColor(Blue);
  
}
Exemple #10
0
void progressBarWin::paintWin()
{
	//背景
	LCD_SetTextColor(GREY1);
	LCD_DrawFullRect(getAbsoluteX(),getAbsoluteY(),getWinWidth(),getWinHigh());
	//进度条
	if(pBarWidth)
	{
		LCD_SetTextColor(BLUE);
		LCD_DrawFullRect(getAbsoluteX(),getAbsoluteY(),pBarWidth,getWinHigh());
	}
	
}
Exemple #11
0
void S640K1_TP_respond(int x,int y)
{
  unsigned char n;
  for(n=0;n<21;n++)
  {
    if(x>S640K1_TP[n][0]&&x<S640K1_TP[n][2]&&y>S640K1_TP[n][1]&&y<S640K1_TP[n][3])
    {
      if(n==19)//模式切换
      {
        //sys_flag=main_panel;
        //return;
        auto_scan_flag=~auto_scan_flag;
        if(auto_scan_flag==0xff)
        {
          skq_scan_thread_create();
          LCD_str(671,352,"自动模式",32,Blue2,Black);
        }
        else if(auto_scan_flag==0x00)
        {
          rt_thread_delete(skq_scan_thread);
          LCD_str(671,352,"手动模式",32,Blue2,Black);
        }
        return;
      }
      else if(n==20)//(退出)
      {
        rt_thread_delete(skq_scan_thread);
        ADC_R_stop();
        ADC_V_stop();
        PowerA_DIS();
        CD4067_DIS();
        sys_flag=main_panel;
        draw_main_panel();
        return;
      }
      else if(n==16)
      {
        ;
      }
      else 
      {        
        LCD_DrawFullRect( S640K1_TP[n][0],   S640K1_TP[n][1],   S640K1_TP[n][2],   S640K1_TP[n][3],  Black, 0);
        S640K1_measure_levels(n);
        LCD_DrawFullRect( S640K1_TP[n][0],   S640K1_TP[n][1],   S640K1_TP[n][2],   S640K1_TP[n][3],  Blue2, 0);
      } 
    }
  }
}
Exemple #12
0
void blinking_digits(char *tstr, unsigned char *oh, unsigned char *om,
		unsigned char *os, unsigned char *ot) {

		drawdigits(tstr,&MyWatchScr[HRSSTR],(int)hours, 10, 80);
		*oh=hours;
		WPrint(&MyWatchScr[SEP1STR], ":");

		drawdigits(tstr,&MyWatchScr[MINSTR],(int)minutes, 80, 80);
		*om=minutes;
		if(mode!=1 && mode != 2)
			WPrint(&MyWatchScr[SEP2STR], ":");

	if (mode!=2) {
		drawdigits(tstr,&MyWatchScr[SECSTR],(int)seconds, 150, 80);
		*os=seconds;
	}
	if (mode == 3) {
		tenths2digit(tstr, (int)tenths);
		LCD_SetTextColor(Black);
		LCD_SetBackColor(Black);
		LCD_DrawFullRect(208, 80, 35, 48);
		WPrint(&MyWatchScr[DOT], ".");
		WPrint(&MyWatchScr[TTSSTR], tstr);
		*ot=tenths;
	}
}
Exemple #13
0
void progressBarWin::paintBarWin()
{
	if(pBarWidth)
	{
	LCD_SetTextColor(BLUE);
	LCD_DrawFullRect(getAbsoluteX(),getAbsoluteY(),pBarWidth,getWinHigh());
	}
}
Exemple #14
0
void drawdigits(char *tstr,const Widget *ws, int digits, int x, int y)
{
	strencode2digit(tstr, digits);
	LCD_SetTextColor(Black);
	LCD_SetBackColor(Black);
	LCD_DrawFullRect(x, y, 62, 48);
	WPrint(ws, tstr);
}
Exemple #15
0
void draw_menu_selector(int choice){

	//affichage du bouton en mode "illuminé
	LCD_DrawFullRect(button[choice].x,button[choice].y,button[choice].width,button[choice].height,0xFFFF,0xFFFF);
	LCD_DisplayStringLine(button[choice].y+6,button[choice].x+5,(uint8_t *)menuText[choice],0x2104,0xffff,LCD_NO_DISPLAY_ON_UART);
	DISP_BMP((uint8_t*)images[choice],button[choice].x+1,button[choice].y+21,100,60);

}
Exemple #16
0
void button::triggerControl(mainWin* mw)
{
	//被触发 白色覆盖按钮 表示被按下
	LCD_SetTextColor(WHITE);
	LCD_DrawFullRect(getWinXpos()+mw->getWinXpos(),getWinYpos()+mw->getWinYpos(),getWinWidth(),getWinHigh());
	while(TouchUp != 1);
	TouchUp = 0;
}
Exemple #17
0
void
draw_bossbullet(bullets bulletsin)
{
	for(int i=0; i<3; i++){
		if(boss1[0].gun[i]==1)
		LCD_DrawFullRect(  bulletsin.bullet[i].ballX, bulletsin.bullet[i].ballY, 10, 10 );
	}

}
Exemple #18
0
void
draw_gun(boss boss2)
{

			if(boss2.gun[0]==1)
			{
				LCD_DrawFullRect( boss2.centerX-10, boss2.centerY-10, 10, 10 );
			}
			if(boss2.gun[1]==1)
			{
				LCD_DrawFullRect( boss2.centerX, boss2.centerY-20, 10, 10 );
			}
			if(boss2.gun[2]==1)
			{
				LCD_DrawFullRect( boss2.centerX+10, boss2.centerY-10, 10, 10 );
			}

}
Exemple #19
0
/*
 * MAIN TASK
 */
int main(void)
{
	//GPIO_InitTypeDef GPIO_InitStructure;

	SystemInit();
	/*Initializes Erika related stuffs*/
	EE_system_init();

	SWatch_state.errorStatus = errorSig;
	SWatch_state.ModelData.prevZCSigState = &ZCSig;
	SWatch_state.ModelData.dwork = &DWork;

	/* init state machine */
	SWatch_initialize(&SWatch_state,
			&Bplus, &Bminus, &Btime, &Btimer, &Balarm, &Bswatch, &Bstart, &Bstop,
			&hours, &minutes, &seconds, &tenths, &mode, &alarm_signal, &timer_exp);

	/*Initialize systick */
	EE_systick_set_period(MILLISECONDS_TO_TICKS(1, SystemCoreClock));
	EE_systick_enable_int();
	EE_systick_start();

	/* Initializes LCD and touchscreen */
	IOE_Config();
	/* Initialize the LCD */
	STM32f4_Discovery_LCD_Init();

	//	LCD_Clear(White);

	/* Set the LCD Text size */
	//	LCD_SetFont(&Font8x12);
	//	Lcd_Touch_Calibration();
	InitTouch(-0.102, 0.0656, -335, 10);

	/* Draw the background */
	DrawInit(MyWatchScr);
	LCD_SetTextColor(Black);
	LCD_SetBackColor(Black);
	LCD_DrawFullRect(10, 80, 240, 56);
	WPrint(&MyWatchScr[SEP1STR], ":");
	WPrint(&MyWatchScr[SEP2STR], ":");


	/* Program cyclic alarms which will fire after an initial offset,
	 * and after that periodically
	 * */
	SetRelAlarm(AlarmTaskLCD, 10, 50);
	SetRelAlarm(AlarmTaskClock, 10, 100);

	/* Forever loop: background activities (if any) should go here */
	for (;;) { 
	}

}
Exemple #20
0
void UpdateTime()
{
	unsigned char watchstr[20];
	setTimeString(watchstr, Swatch2018_Y_hours, Swatch2018_Y_minutes, Swatch2018_Y_seconds, Swatch2018_Y_tenths, Swatch2018_Y_mode);

	LCD_SetTextColor(Black);
	LCD_SetBackColor(Black);
	LCD_DrawFullRect(30, 76, 160, 32);

/*	WPrint(&MyWatchScr[TIMESTR], watchstr); */
}
Exemple #21
0
void
draw_mybullet(bullets bulletsin)
{
	
	for(int i=0; i<3;i++)
	{
		
		if(bulletsin.bullet[i].ballIsRun==1) 
			LCD_DrawFullRect( bulletsin.bullet[i].ballX, bulletsin.bullet[i].ballY, 10, 10 );		
	}

}
Exemple #22
0
void button::layoutControl(mainWin* mw)
{
	//如果由控件图标,就用图标
	/*if(icon){
	}else{
		LCD_SetTextColor(getBackColor());
		LCD_DrawFullRect(getWinXpos()+mw->getWinXpos(),getWinYpos()+mw->getWinYpos(),getWinWidth(),getWinHigh());
	}*/
	//先这么用
	LCD_SetTextColor(getBackColor());
	LCD_DrawFullRect(getWinXpos()+mw->getWinXpos(),getWinYpos()+mw->getWinYpos(),getWinWidth(),getWinHigh());
}
Exemple #23
0
void
draw_me(me me2)
{
		for(int i=0; i<2;i++)
		{
			for(int j=0;j<3;j++)
			{
				if(body[i][j]==1) 
					LCD_DrawFullRect( me2.centerX-10*(j-2), me2.centerY+10*i, 10, 10 );
			}
		}

}
Exemple #24
0
/**
* @brief  Configure the IO Expander and the Touch Panel.
* @param  None
* @retval None
*/
static void TP_Config(void)
{
  /* Clear the LCD */ 
  LCD_Clear(LCD_COLOR_WHITE);
  
  /* Configure the IO Expander */
  if (IOE_Config() == IOE_OK)
  {   
    LCD_SetFont(&Font8x8);
    LCD_DisplayStringLine(LINE(32), (uint8_t*)"              Touch Panel Paint     ");
    LCD_DisplayStringLine(LINE(34), (uint8_t*)"              Example               ");
    LCD_SetTextColor(LCD_COLOR_BLUE2); 
    LCD_DrawFullRect(5, 250, 30, 30);
    LCD_SetTextColor(LCD_COLOR_CYAN); 
    LCD_DrawFullRect(40, 250, 30, 30);
    LCD_SetTextColor(LCD_COLOR_YELLOW); 
    LCD_DrawFullRect(75, 250, 30, 30);
    LCD_SetTextColor(LCD_COLOR_RED); 
    LCD_DrawFullRect(5, 288, 30, 30);
    LCD_SetTextColor(LCD_COLOR_BLUE); 
    LCD_DrawFullRect(40, 288, 30, 30);
    LCD_SetTextColor(LCD_COLOR_GREEN); 
    LCD_DrawFullRect(75, 288, 30, 30);
    LCD_SetTextColor(LCD_COLOR_MAGENTA); 
    LCD_DrawFullRect(145, 288, 30, 30);
    LCD_SetTextColor(LCD_COLOR_BLACK); 
    LCD_DrawFullRect(110, 288, 30, 30);
    LCD_DrawRect(180, 270, 48, 50);
    LCD_SetFont(&Font16x24);
    LCD_DisplayChar(LCD_LINE_12, 195, 0x43);
    LCD_DrawLine(0, 248, 240, LCD_DIR_HORIZONTAL);
    LCD_DrawLine(0, 284, 180, LCD_DIR_HORIZONTAL);
    LCD_DrawLine(1, 248, 71, LCD_DIR_VERTICAL);
    LCD_DrawLine(37, 248, 71, LCD_DIR_VERTICAL);
    LCD_DrawLine(72, 248, 71, LCD_DIR_VERTICAL);
    LCD_DrawLine(107, 248, 71, LCD_DIR_VERTICAL);
    LCD_DrawLine(142, 284, 36, LCD_DIR_VERTICAL);
    LCD_DrawLine(0, 319, 240, LCD_DIR_HORIZONTAL);
  }  
  else
  {
    LCD_Clear(LCD_COLOR_RED);
    LCD_SetTextColor(LCD_COLOR_BLACK); 
    LCD_DisplayStringLine(LCD_LINE_6,(uint8_t*)"   IOE NOT OK      ");
    LCD_DisplayStringLine(LCD_LINE_7,(uint8_t*)"Reset the board   ");
    LCD_DisplayStringLine(LCD_LINE_8,(uint8_t*)"and try again     ");
  }
}
Exemple #25
0
void
draw_boss(boss boss2)
{
		for(int i=0; i<2;i++)
		{
			for(int j=0;j<3;j++)
			{
				if(body[i][j]==1) 
					LCD_DrawFullRect( boss2.centerX-10*(j-1), boss2.centerY-10*i, 10, 10 );
			}
		}
	
			
}
Exemple #26
0
void menu_screen(){

	//initialisation des variables
	int i,j,text = 0;

	//fond d'écran, header, footer
	create_rectangle(0,0,320,240,0x5ACB);
	header(5,FALSE,TRUE);

	//Choix de la taille de police pour l'écriture dans le header
	LCD_SetFont(&Bebasn);

	//affichage des icônes dans le menu
	for(i=0;i<2;i++){
		for(j=0;j<3;j++){
			if(i == 1 && j > 0){
				//DO NOTHING
			}else{
				LCD_DrawFullRect((104*j)+5,(84*i)+38,102,81,0x2104,0xFFFF);
				LCD_DrawFullRect((104*j)+5,(84*i)+38,102,20,0x2104,0x2104);
				LCD_DisplayStringLine((84*i)+44,(105*j)+10,(uint8_t *)menuText[text],0xffff,0x2104,LCD_NO_DISPLAY_ON_UART);
				DISP_BMP((uint8_t*)images[text],(104*j)+6,(84*i)+59,100,60);

				//bufferisation de la position des boutons
				create_button(button,text,(104*j)+5,(84*i)+38,102,81);

				text++;
			}
		}
	}

	footer(MAIN);

	//on lance l'acquisition sur l'écran tactile
	read_screen(button,MAIN,4);
}
Exemple #27
0
void dessin_menu_sms(char * NUMERO, char * SUBJECT, char * SMS){
	LCD_Clear(LCD_COLOR_WHITE);
	LCD_DrawFullRect(39,0,3,240, 0x2589, 0x2589);
	LCD_DrawFullRect(42,39,320-42,3, 0xfbe4, 0xfbe4);
	LCD_SetFont(&Font12x12);
	char string_SMS[] = "   MAIL    ";
	char string_SMS_AFFICHER[] = "AFFICHER";
	char string_SMS_CHARGER[] = "CHARGER";
	char string_SMS_NOUVEAU[] = "NOUVEAU";
	char string_SMS_REPONDRE[] = "REPONDRE";
	LCD_DisplayStringLine(LINE(2)-2, COLUMN(10), (uint8_t *)string_SMS, 0xfbe4, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_SetFont(&Font8x8);
	LCD_DisplayStringLine(LINE(28)-2, COLUMN(6)-2, (uint8_t *)string_SMS_AFFICHER, 0xfbe4, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(28)-2, COLUMN(15), (uint8_t *)string_SMS_CHARGER, 0xfbe4, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(28)-2, COLUMN(24)-5, (uint8_t *)string_SMS_NOUVEAU, 0xfbe4, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(28)-2, COLUMN(32)-2, (uint8_t *)string_SMS_REPONDRE, 0xfbe4, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	char string_Q[] = "Q";
	char string_U[] = "U";
	char string_I[] = "I";
	char string_T[] = "T";
	char string_TT[] = "T";
	char string_E[] = "E";
	char string_R[] = "R";
	LCD_SetFont(&Font12x12);
	LCD_DisplayStringLine(LINE(4), COLUMN(1)+4, (uint8_t *)string_Q, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(6), COLUMN(1)+4, (uint8_t *)string_U, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(8), COLUMN(1)+6, (uint8_t *)string_I, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(10), COLUMN(1)+4, (uint8_t *)string_T, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(12), COLUMN(1)+4, (uint8_t *)string_TT, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(14), COLUMN(1)+4, (uint8_t *)string_E, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	LCD_DisplayStringLine(LINE(16), COLUMN(1)+4, (uint8_t *)string_R, 0x3a59, LCD_COLOR_WHITE,LCD_NO_DISPLAY_ON_UART);
	display_numero_message(NUMERO);
	display_subject_message(SUBJECT);
	display_message(SMS);
	delay(100);
}
Exemple #28
0
void DrawBackground(void)
{
	struct graph_info *graph;

	LCD_SetTextColor(LCD_COLOR_WHITE);
	for (graph = fence_info; graph->wl.width; graph++) {
		LCD_DrawFullRect(graph->x, graph->y, 
					graph->wl.width, graph->hd.height);
	}

	LCD_SetTextColor(LCD_COLOR_YELLOW);
	for (graph = dline_info; graph->wl.len; graph++) {
		LCD_DrawLine(graph->x, graph->y, graph->wl.len, graph->hd.dir);
	}
}
Exemple #29
0
void draw_keyboard_selector(int choice){

	//initialisation de l'écran tactile
	char * temp[20]={},hidden[20]={};
	int i, len = strlen(password);

	//on redessine la touche pressée en style "appuyé"
	LCD_DrawFullRect(button[choice].x,button[choice].y,button[choice].width,button[choice].height,0x39C7,0x39C7);
	LCD_DisplayStringLine(button[choice].y+11,button[choice].x+11,(uint8_t *)string[choice],0xD6BA,0x39C7,LCD_NO_DISPLAY_ON_UART);

	//masquage des précédents caractères composant le mot de passe
	if(len<20){
		for(i=0;i<len;i++){
			strcpy(temp,hidden);
			sprintf(hidden,"%s-",(uint8_t *)temp);
		}
		sprintf(password,"%s%s",(uint8_t *)hidden,(uint8_t *)string[choice]);
	}

	LCD_DisplayStringLine(52,15,(uint8_t *)password,0x39C7,0xD6BA,LCD_NO_DISPLAY_ON_UART);

}
/**
  * @brief  This function handles External line 0 interrupt request.
  * @param  None
  * @retval None
  */
void EXTI0_IRQHandler(void)
{
  if((EXTI_GetITStatus(WAKEUP_BUTTON_EXTI_LINE) != RESET))
  {
    /* Set the LCD Back Color */
    LCD_SetBackColor(White);
    
    /* Clear the LCD line 2 */
    LCD_ClearLine(Line2);
   
    /* Disable the RTC Clock */
    RCC_RTCCLKCmd(DISABLE);
   
    /* Reset Counter*/
    uwRTCAlarmCount = 0;
    
    /* Disable the alarm */
    RTC_AlarmCmd(RTC_Alarm_A, DISABLE);
    
    /* Set the LCD Back Color */
    LCD_SetBackColor(White);
  
    /* Display a Full rectangle on the LCD */
    LCD_DrawFullRect(80, 290,240, 25 );
    
    /* Set LCD text color */
    LCD_SetTextColor(Red);

    /* Display rectangle on the LCD */
    LCD_DrawRect(80, 290, 25, 240 );
    
    /* Clear the WAKEUP EXTI  pending bit */
    EXTI_ClearITPendingBit(WAKEUP_BUTTON_EXTI_LINE);  
  }

}