• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LCD_Clear函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LCD_Clear函数的典型用法代码示例。如果您正苦于以下问题:C++ LCD_Clear函数的具体用法?C++ LCD_Clear怎么用?C++ LCD_Clear使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LCD_Clear函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: prvInit

void
prvInit()
{
	//LCD init
	LCD_Init();
	IOE_Config();
	LTDC_Cmd( ENABLE );

	LCD_LayerInit();
	LCD_SetLayer( LCD_FOREGROUND_LAYER );
	LCD_Clear( LCD_COLOR_BLACK );
	LCD_SetTextColor( LCD_COLOR_WHITE );

	//Button
	STM_EVAL_PBInit( BUTTON_USER, BUTTON_MODE_GPIO );

	//LED
	STM_EVAL_LEDInit( LED3 );
}
开发者ID:binoct,项目名称:myFreeRTOS,代码行数:19,代码来源:main.c


示例2: fputc

/*-----------------------------------------------------------*/
int fputc( int ch, FILE *f )
{
static unsigned portSHORT usColumn = 0, usRefColumn = mainCOLUMN_START;
static unsigned portCHAR ucLine = 0;

	if( ( usColumn == 0 ) && ( ucLine == 0 ) )
	{
		LCD_Clear(LCD_White);
	}

	if( ch != '\n' )
	{
		/* Display one character on LCD */
		LCD_PutChar(320 - usRefColumn, ucLine, (u8) ch, LCD_Red, LCD_White);

		/* Decrement the column position by 16 */
		usRefColumn -= mainCOLUMN_INCREMENT;

		/* Increment the character counter */
		usColumn++;
		if( usColumn == mainMAX_COLUMN )
		{
			ucLine += mainROW_INCREMENT;
			usRefColumn = mainCOLUMN_START;
			usColumn = 0;
		}
	}
	else
	{
		/* Move back to the first column of the next line. */
		ucLine += mainROW_INCREMENT;
		usRefColumn = mainCOLUMN_START;
		usColumn = 0;
	}

	/* Wrap back to the top of the display. */
	if( ucLine >= mainMAX_LINE )
	{
		ucLine = 0;
	}

	return ch;
}
开发者ID:Dzenik,项目名称:FreeRTOS_TEST,代码行数:44,代码来源:main.c


示例3: main

int main()
{
    WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer

    Config_Clocks(); //配置时钟
    Config_Port();

    PGA_IO_Init();// 默认通道CH0


    LCD_IO_set();

    LCD_Init(); //初始化液晶
    LCD_Clear();
    LCD_Write_String(0,0,LCD_BUFFER);
    _EINT();

    while(1);
}
开发者ID:eseawind,项目名称:MCU,代码行数:19,代码来源:main.c


示例4: LCD_PrintMsg

// Display a string on the LCD with automatic carriage return
void LCD_PrintMsg(u8 *ptr)
{
  u8 Char = 0;
  u8 CharPos = 0;

  LCD_Clear(); /* Clear the LCD display */

  /* Set cursor to home position on line 1 */
  LCD_SendByte(COMMAND_TYPE, LCD_LINE1);

  /* Send String */
  while ((*ptr != 0) && (CharPos < (LCD_LINE_MAX_CHAR * 2)))
  {
    /* Check if string length is bigger than LINE1 */
    if (CharPos == LCD_LINE_MAX_CHAR)
    {
      LCD_SendByte(COMMAND_TYPE, LCD_LINE2); /* Select second line */
    }

    Char = *ptr;

    switch (Char)
    {
      case ('\r'):
        /* Carriage return */
        CharPos++;
        ptr++;
      break;
      case ('\n'):
        CharPos = 0;
        ptr++;
        /* Set cursor to line 2 */
        LCD_SendByte(COMMAND_TYPE, LCD_LINE2);
      break;
      default:
        /* Display characters different from (\r, \n) */
        LCD_SendByte(DATA_TYPE, Char);
        CharPos++;
        ptr++;
      break;
    }
  }
}
开发者ID:Amirelecom,项目名称:brush-v1,代码行数:44,代码来源:mono_lcd.c


示例5: LCD_LOG_SetHeader

/**
* @brief  Display the application header (title) on the LCD screen 
* @param  Title :  pointer to the string to be displayed
* @retval None
*/
void LCD_LOG_SetHeader (uint8_t *Title)
{
  sFONT *cFont;
  uint32_t size = 0 , idx; 
  uint8_t  *ptr = Title;
  uint8_t  tmp[27];
  
  /* center the header */
  while (*ptr++) size ++ ;

  /* truncate extra text */
  if(size > 26)
  {
     size = 26;
  }
  
  for (idx = 0 ; idx < 27 ; idx ++)
  { 
    tmp[idx] = ' '; 
  }

  for (idx = 0 ; idx < size ; idx ++)
  { 
    tmp[idx + (27 - size)/2] = Title[idx];
  }
  
  /* Clear the LCD */
  LCD_Clear(Black);
    
  /* Set the LCD Font */
  LCD_SetFont (&Font12x12);

  cFont = LCD_GetFont();  
  /* Set the LCD Text Color */
  LCD_SetTextColor(White);
  LCD_SetBackColor(Blue);
  LCD_ClearLine(0);
  LCD_DisplayStringLine(cFont->Height, tmp);
  LCD_ClearLine(2 * cFont->Height);

  LCD_SetBackColor(Black);
  LCD_SetFont (&Font8x12);
}
开发者ID:glockwork,项目名称:WirelessAmmeterRepeater,代码行数:48,代码来源:lcd_log.c


示例6: main

 int main(void)
 { 
	u8 i=0;
  	HEADCOLOR *imginfo;
	u16 x=0,y=0;
	u16 x0,y0;
 	imginfo=(HEADCOLOR*)gImage_image1;	//得到文件信息 
	delay_init();	    	 //延时函数初始化	  
	uart_init(9600);	 	//串口初始化为9600
	LED_Init();			//LED初始化
 	LCD_Init(); 	    //LCD初始化					 
	delay_ms(1500);		//等待1.5秒	  
	srand(imginfo->h*imginfo->w);
	while(1) 
	{		   
		if(i==0)
		{
			LCD_Clear(0X0000);//黑屏  
			if(imginfo->w>=lcddev.width||imginfo->h>=lcddev.height)
			{
				POINT_COLOR=RED;   	
				delay_ms(200);
				LCD_ShowString(10,70,200,16,16,"The Picture is too large");	
				delay_ms(200);
				continue;
			}
			x0=x;y0=y;
			while((x+imginfo->w)>lcddev.width||x==x0)//超过屏幕尺寸了
			{
				x=rand();//获得随机的x值
			}
			while((y+imginfo->h)>lcddev.height||y==y0)//超过屏幕尺寸了
			{
				y=rand();//获得随机的y值
			}
			image_display(x,y,(u8*)gImage_image1);//在指定地址显示图片
		}
		i++;
		if(i>10)i=0; 
		LED0=!LED0;					 
		delay_ms(200);	
	}											    
}
开发者ID:FateMouse,项目名称:STM32-FLASHPhoto,代码行数:43,代码来源:main.c


示例7: main2

void main2(void) {
  PLL_Init();
  LCD_Init();
  OC_Init2();
  TIE  |= 0x04;
  LCD_Clear();
  
  DDRP |= 0x80;  // LED
  asm cli

  while(1) {
    PTP ^= 0x80; // flash LED
    printf("a");   //output a on first line
    main_loc = (main_loc + 1) % 8;  //update location on main line
    Timer_Wait_1ms(500);
    if ( main_loc == 0 )
      LCD_GoTo(1,1);    //wrap around
  } 
}
开发者ID:NickCarneiro,项目名称:EE445L-Labs,代码行数:19,代码来源:main.c


示例8: Load_Sys_ICO

//加载主界面
void Load_Sys_ICO(void)
{		  
	u8 t,tx;
	u16 ty;	   
	FileInfoStruct temp; 
	POINT_COLOR=RED;//黑色字体				   
    LCD_Clear(WHITE);//清屏 
	temp.F_Type=T_BMP;//文件属性设置 
	tx=10;ty=10;
	for(t=0;t<9;t++)
	{	   
		temp.F_StartCluster=sys_ico[t];								    
		tx=80*(t%3)+10;//10,90,170	    
		AI_LoadPicFile(&temp,tx,ty,tx+59,ty+60);
		Select_Menu(0,t,0);//加载字体    		  
		if(t>=5)ty=216;
		else if(t>=2)ty=113;  
	}
}
开发者ID:nvero,项目名称:fmhobby,代码行数:20,代码来源:gui.c


示例9: main

void main(void) {
	WDTCTL=WDTPW+WDTHOLD;
    BCSCTL1 = CALBC1_16MHZ;      /* Set DCO to16MHz */
    DCOCTL = CALDCO_16MHZ;
	__delay_cycles(100000);			//等待电压稳定
	TCA6416A_Init();
	Slope_Measure_Init();
	HT1621_init();
	LCD_Clear();
	Display_SLOPE();
	HT1621_Reflash(LCD_Buffer);
	//-----设定WDT为16ms定时中断-----
	WDTCTL=WDT_ADLY_16;
	//-----WDT中断使能-----
    IE1|=WDTIE;
	 _enable_interrupts();

	while(1);
}
开发者ID:201409366,项目名称:msp430G2,代码行数:19,代码来源:main.c


示例10: main

int main(int argc, char *argv[])
{
  //BOOTLOADER_reset();

  int r;
  __enable_irq();
  //NVIC_SetVectorTable(NVIC_VectTab_FLASH, 0x4000); // make sure that
  // interrupts work
  clock_init(); // hey, you can overclock later here. maybe.



  JSON_init();
  USART_Config();
  TIM_init();

  LCD_Configuration();
  LCD_Initialization();
  LCD_Clear(LCD_Black);

  USART_PutString(HOST_USART,"***** INIT DONE *****\n");

  while(1) {

    r = JSON_render();

    // todo: better error reporting
    if(r == 3) {
      // no free bufs
      continue;
    } else if(r != 0) {
      JSON_init(); // reset buffers in case of errors
      char abuf[32];
      itoa(abuf, r, 10);
      USART_PutString(HOST_USART, abuf);
      USART_PutChar(HOST_USART, 'N');
      USART_PutChar(HOST_USART, '\n');
    }
    //USART1_PutChar('A');
    __asm__("WFI"); // sleep for a bit.
  }
  return 0;
}
开发者ID:jh247247,项目名称:vassal,代码行数:43,代码来源:main.c


示例11: main

/**
  * @brief Example  main entry point.
  * @par Parameters:
  * None
  * @retval 
  * None
  */
void main(void)
{

    /* Initialize SPI for LCD */
    SPI_DeInit();
    SPI_Init(SPI_FIRSTBIT_MSB, SPI_BAUDRATEPRESCALER_128, SPI_MODE_MASTER, SPI_CLOCKPOLARITY_HIGH, SPI_CLOCKPHASE_2EDGE, SPI_DATADIRECTION_1LINE_TX, SPI_NSS_SOFT, 0x07);
    SPI_Cmd(ENABLE);

    
    /* Configure GPIO used to drive the joystick
	      JOYSTICK_UP    --> PB6
	      JOYSTICK_DOWN  --> PB7
	      JOYSTICK_LEFT --> PB4
	*/
  GPIO_Init(GPIOB, GPIO_PIN_4 | GPIO_PIN_6 | GPIO_PIN_7, GPIO_MODE_IN_FL_IT);
  EXTI_SetExtIntSensitivity(EXTI_PORT_GPIOB, EXTI_SENSITIVITY_FALL_LOW);
	
	enableInterrupts();
    
    
    /* Initialize LCD */
    LCD_Init();

    /* Clear LCD lines */
    LCD_Clear();

    LCD_Backlight(ENABLE);

    LCD_PrintString(LCD_LINE1, ENABLE, DISABLE, "Clock Selection");
    LCD_PrintString(LCD_LINE2, ENABLE, DISABLE, " Use joystick");

    CLK_DeInit();
		CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1);
    /* Output Fcpu on CLK_CCO pin */
    CLK_CCOConfig(CLK_OUTPUT_MASTER);

    while (1)
    {
  
    }

}
开发者ID:KNVRK,项目名称:STM8SProjects,代码行数:49,代码来源:main.c


示例12: PowerOnSetProc

void PowerOnSetProc()
{		 	
	port_b_pullups(TRUE);	output_b(0xff); output_c(0xff);		
	
	set_tris_A(0b00000011);	set_tris_B(0b01111111);

	set_tris_D(0b00000000);	set_tris_E(0b00000000);
	
	set_tris_C(0b10010000);
	
	setup_adc_ports(NO_ANALOGS);
	setup_adc(ADC_OFF);

	setup_comparator(NC_NC_NC_NC);
	setup_vref(FALSE);
	setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);

	setup_timer_2(T2_DIV_BY_4,250,2);		 // 8,000,000 / (4 * 8 * (249 +1)) = 1,000 = 1/1000 sec
	set_timer2(0);
	enable_interrupts(INT_TIMER2);
	
	// LCD 초기화 하기 전에 대기 없으면 이상한 현상이 생김  
	delay_ms(100); 

	LCD_Initialization();				

	setup_psp(PSP_DISABLED);	
	delay_ms(250);
	SerialPortSetup();	

	LCD_Clear();
	enable_interrupts(INT_RDA);	
	enable_interrupts(GLOBAL);	

             //"01234567890123456789"
	strcpy(st, "DIGITAL OPERAT      "); PrintLCD(0,0,st);
	strcpy(st, "[EwDo-21] v2.60     "); PrintLCD(1,0,st);
	strcpy(st, "EunWho Power Electic"); PrintLCD(2,0,st);
	strcpy(st, "TEL 82-51-262-7532  "); PrintLCD(3,0,st);
	delay_ms(3250);
	delay_ms(3250);
}
开发者ID:eunwho,项目名称:lcdConverter,代码行数:42,代码来源:main.C


示例13: main

int main()
{
	struct Timer fps;
	
	time_t current;
	struct tm *current_tm;
	struct Banner date_banner = {
		.string = date_string,
		.offset = 0
	};

	if (LCD_Init() != 0) {
		printf("Error initializing LCD\n");
		return 1;
	}

	LCD_SetBacklight(1);

	for (;;) {

		timer_start(&fps);

		current = time(NULL);
		current_tm = localtime(&current);
		string_print_date(date_string, current_tm);

		LCD_Clear();
		draw_clock_frame();
		draw_time(current_tm);
		update_banner(&date_banner);
		draw_banner(&date_banner, 0);
		draw_banner(&date_banner, 38);
		LCD_Display();

		if (timer_get_msecs(&fps) < 1000 / FRAMES_PER_SECOND) {
			usleep(1000 * ( 1000 / FRAMES_PER_SECOND ) - timer_get_msecs(&fps));
		}

	}

	return 0;
}
开发者ID:Siapran,项目名称:Nokia5110LCD,代码行数:42,代码来源:clock.c


示例14: main

int main(void)
{
	uint8_t i, j;
	SysTick_Config(SystemCoreClock/1000); //1ms tick
	RCC_Init();
	USARTInit();
	LCD_Init();
	LED_Init();
	LED_On();
	LCD_Clear();

	//LCD_char(0, 0, 0);
	LCD_String("abcdefg",0,0);
	LCD_String("6543210",0,3);
	while(1){
		delay_ms(100);
		printf("done!\n\r");
		LED_Toogle();
	}
}
开发者ID:RadiationSolutions,项目名称:F030C6T6-Prototype,代码行数:20,代码来源:main.c


示例15: main

/* 修复了上下颠倒的BUG,enjoy~
 * 要想中文显示成功
 * 需把字库拷贝到sd卡上,然后把sd卡插到开发板的卡槽上
 */
int main(void)
{
   /* USART1 config */
		//USART1_Config();
		//printf("\r\n this is a fatfs test demo \r\n");
	
		LCD_Init();
	
		/* 设置Lcd Gram 扫描方向为: 右下角->左上角 */		
		Lcd_GramScan( 3 );	
		LCD_Clear(0, 0, 320, 240, BACKGROUND);	
		
		/* 初始化sd卡文件系统,因为汉字的字库和bmp图片放在了sd卡里面 */
		Sd_fs_init();
	

		Screen_shot(0,0,320,240,"/myscreen");
		
		while(1);
}
开发者ID:luoxufeiyan,项目名称:STM32,代码行数:24,代码来源:main.c


示例16: FM_DisplayChannel

void FM_DisplayChannel(int channel, xpos, ypos){
	LCD_Clear();
	LCD_GoTo(xpos,ypos);
	if(channel<1000){
		LCD_WriteInt(digitAtPos(channel,1), true);
		LCD_GoTo(xpos+LARGE_SPACE, ypos);
		LCD_WriteInt(digitAtPos(channel,2), true);
		LCD_GoTo(xpos+LARGE_SPACE+SMALL_SPACE, ypos);
		LCD_WriteInt(digitAtPos(channel,3),true);
	}
	else{
		LCD_WriteInt(digitAtPos(channel,1), true);
		LCD_GoTo(xpos+LARGE_SPACE, ypos);
		LCD_WriteInt(digitAtPos(channel,2), true);
		LCD_GoTo(xpos+LARGE_SPACE+LARGE_SPACE, ypos);
		LCD_WriteInt(digitAtPos(channel,3),true);
		LCD_GoTo(xpos+2*LARGE_SPACE+SMALL_SPACE);
		LCD_WriteInt(digitAtPos(channel,4),true);
	}
}
开发者ID:nickrunner,项目名称:ACR,代码行数:20,代码来源:FM_Driver.c


示例17: draw_from_db

/**
 *	Draw the list of coordinates currently in the database
 *
 *	@author HP Truong, Jacob Barnett
 *
 *	@param void
 *	@return void 
 */
void draw_from_db(void) {
	LCD_Clear(LCD_COLOR_WHITE);
	LCD_SetTextColor(LCD_COLOR_RED);
	memcpy ( (void *)(LCD_FRAME_BUFFER + BUFFER_OFFSET), (void *) ((uint8_t*) (&background)), sizeof(background));
	
	uint8_t len = coordinate_db_get_len();
	if (len == 0) {
		return;
	}

	static coordinate next_coord;

	for (uint8_t i = 0; i < len; i++) {
		coordinate_db_get_entry(i, &next_coord);
		xs[i] = next_coord.x;
		ys[i] = next_coord.y;
	}

	draw_points(1, 1, xs, ys, len);
}
开发者ID:hptruong93,项目名称:Microprocessor-Fall-2015,代码行数:28,代码来源:main.c


示例18: main

int main() {
    PWR_Init();
    CLOCK_Init();
    UART_Initialize();
    if(PWR_CheckPowerSwitch()) PWR_Shutdown();
#if SPI_BOOTLOADER
    Initialize_ButtonMatrix();
    SPIFlash_Init(); //This must come before LCD_Init() for 7e
    SPI_FlashBlockWriteEnable(1); //Enable writing to all banks of SPIFlash
    LCD_Init();
    LCD_Clear(0x0000);
    BACKLIGHT_Init();
    BACKLIGHT_Brightness(5);
    LCD_SetFont(0);
    LCD_SetFontColor(0xffff);
    dump_bootloader(0);
#else
    dump_bootloader(1);
#endif
}
开发者ID:theseankelly,项目名称:deviation,代码行数:20,代码来源:main.c


示例19: COMP_PulseWidthMeasurement

/**
  * @brief  Main program.
  * @param  None
  * @retval None
  */
void COMP_PulseWidthMeasurement(void)
{
  /*!< At this stage the microcontroller clock setting is already configured, 
       this is done through SystemInit() function which is called from startup
       file (startup_stm32f30x.s) before to branch to application main.
       To reconfigure the default setting of SystemInit() function, refer to
       system_stm32f30x.c file
     */

  /* Initialize the TFT-LCD */
  STM32303C_LCD_Init();
  
  /* Clear the TFT-LCD */
  LCD_Clear(LCD_COLOR_WHITE);
  
  /* DAC Channel1 configuration */
  DAC_Config();
  
  /* COMP1 Configuration */
  COMP_Config();
  
  /* TIM2 Configuration in input capture mode */
  TIM_Config();
  
  /* Displays PulseWidthMeasurement message on line 0 */
  LCD_DisplayStringLine(LINE(0), (uint8_t *)MESSAGE1);

  /* Infinite loop */
  while (1)
  {
    if (DisplayActive != 0)
    {
      /* Compute the pulse width in us */
      MeasuredPulse = (uint32_t)(((uint64_t) Capture * 1000000) / ((uint32_t)SystemCoreClock));
      
      /* Display measured pulse width on LCD */
      LCD_Display(MeasuredPulse);  
      DisplayActive = 0;
    }
  }
}
开发者ID:clarenceliu,项目名称:Mplib,代码行数:46,代码来源:COMP_PulseWidthMeasurement.c


示例20: sys_sonic

void sys_sonic(void)
{
	rt_uint32_t key_value;
    
	while(1)
	{
		LCD_Clear();
		LCD_SetXY(0,0); LCD_WriteString("====pole_test====");
		LCD_SetXY(0, 1); LCD_WriteString("1.step1");
        LCD_SetXY(0, 2); LCD_WriteString("2.xypid");
        LCD_SetXY(0, 3); LCD_WriteString("3.pw1");
        LCD_SetXY(0, 4); LCD_WriteString("4.dis");
        
        LCD_SetXY(10, 1); LCD_WriteString("5.sd save");
        LCD_SetXY(10, 2); LCD_WriteString("6.");
        LCD_SetXY(10, 3); LCD_WriteString("7.");
        LCD_SetXY(10, 4); LCD_WriteString("8.");
		
		if(rt_mb_recv(&Mb_Key, &key_value, RT_WAITING_NO) == RT_EOK)
		{
			switch(key_value)
			{
				case key1:  _step1();       break;
				case key2:  pw1_pid();      break;
                case key3:  sonic_pw1();    break;
                case key4:  
                    Input_DoubleValue(&std_fdis, "f dis");    
                    Input_DoubleValue(&std_sdis, "s dis");
                case key5:
                {
                    int _sonicx = 0 ;
                    Input_IntValue(&_sonicx, "_sonicx");
                    sonic_SDsave(_sonicx, "sonic_data", 500);
                }  
                break;
                case keyback:               return;
			}
		}
		Delay_ms(10);
	}
}
开发者ID:yihui-he,项目名称:Badminton-Robot,代码行数:41,代码来源:sonic1.c



注:本文中的LCD_Clear函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LCD_ClearLine函数代码示例发布时间:2022-05-30
下一篇:
C++ LCD_CS_LOW函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap