当前位置: 首页>>代码示例>>C++>>正文


C++ LCD_DisplayString函数代码示例

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


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

示例1: LCD_DisplayMenu

uint8_t LCD_DisplayMenu()
{ 
	int8_t keycount=0;
	LCD_Clear();
	LCD_GoToLine(1);
	LCD_DisplayString("    Settings    ");
	do
	{       
		if (util_IsBitCleared(Button, cancel))
		{
		   return (-1); 
		}
		
		if(util_IsBitCleared(Button, up))
		{
			keycount++;
			_delay_ms(100);
		}
		
		if(util_IsBitCleared(Button, down))
		{
			keycount--;
			_delay_ms(100);
		}
	
		if((keycount>=menusize)||(keycount <= -menusize))
		{
			keycount=0;
		}
		
		if(keycount<0)
		{
			//make menu index circular. i.e decrement from first 
			//option shows the last option on the menu
			keycount += menusize;   
		}			
		
		LCD_GoToLine(2);
		LCD_DisplayString("                "); //clear second line
		//set cursor at the center of of line 2 depending on string size. 
		LCD_SetCursor(2,(14-strlen(settings[keycount]))/2); 
		LCD_Printf("<%s>", settings[keycount]);
		_delay_ms(100);  //make menu visible or else will overwrite at fast speed
					 
      }while(util_IsBitSet(Button,select));
	  
	 do 
	{
		if (util_IsBitCleared(Button, cancel))
		{
		   return (-1); ; 
		}
	}while(util_IsBitSet(Button, select));
	
	return (keycount); 
}
开发者ID:ExploreEmbedded,项目名称:Explore-Time-DIY-11003,代码行数:56,代码来源:Clock.c

示例2: LCD_4bit_test

void LCD_4bit_test()
{
     UART_TxString("\n\r LCD DataBus:(PD4-PD7)  RS-PB.0  RW-PB.1  EN-PB.2 ");
      UART_Printf("\n\r Make connections and hit 'k' to test ");
      while(UART_RxChar()!='k');
      LCD_SetUp(PB_0,PB_1,PB_2,P_NC,P_NC,P_NC,P_NC,PD_4,PD_5,PD_6,PD_7);
      LCD_Init(2,16);
      DELAY_ms(100);
      LCD_DisplayString("Explore Embedded");
      LCD_DisplayString("Lcd 4-bit Mode");
      while(1);
}
开发者ID:ExploreEmbedded,项目名称:Pic16f877a_ExploreUltraPicDevKit,代码行数:12,代码来源:main.c

示例3: main

int main()
{
	/*Connect RS->PB0, RW->PB1, EN->PB2 and data bus to PORTC.4 to PORTC.7*/
	LCD_SetUp(PB_0,PB_1,PB_2,P_NC,P_NC,P_NC,P_NC,PC_4,PC_5,PC_6,PC_7);
	LCD_Init(2,16);
	
	LCD_DisplayString("Explore Embedded");
	LCD_DisplayString("Lcd 4-bit Mode");
	while(1);
	
	return (0);
}
开发者ID:ExploreEmbedded,项目名称:ATMega-128-Break-Out-BoardDVB-12007,代码行数:12,代码来源:main.c

示例4: touch_adjust

//触摸屏校准代码
//得到四个校准参数
void touch_adjust(void)
{
	u16 tempVal[4][2]={0};
	u16 adjPointX[4]={20,340,20,340};
	u16 adjPointY[4]={20,20,220,220};
	u8 i;
						 
	LCD_Clear(White);//清屏 
	LCD_SetBackColor(White);
	LCD_SetTextColor(Black);
	LCD_DisplayString(24,110,"点击屏幕上红点进行校准"); 
	DelayMS(1000);
	
	LCD_Clear(White);//清屏 
	LCD_SetTextColor(Red);
	penPoint.keyState=Up;
	
AG:	i=0;
	do
	{		
		LCD_DrawCircle(adjPointX[i],adjPointY[i],1);
		LCD_DrawCircle(adjPointX[i],adjPointY[i],2);
		LCD_DrawCircle(adjPointX[i],adjPointY[i],3);
		LCD_DrawCircle(adjPointX[i],adjPointY[i],4);

		if(penPoint.keyState==Down)
		{
			if(GetTouchValue())
			{
				tempVal[i][0]=penPoint.x;
				tempVal[i][1]=penPoint.y;
				LCD_Clear(White);//清屏
				DelayMS(100);	
				i++;
			}
		}
		penPoint.keyState=Up;		
	}while(i<4);

	if(IsOk(tempVal)==0)goto AG;

	penConfig.xfac=(float)(340-20)/(tempVal[1][0]-tempVal[0][0]);
	penConfig.yfac=(float)(220-20)/(tempVal[3][1]-tempVal[0][1]);
	penConfig.xoff=20-penConfig.xfac*tempVal[0][0];
	penConfig.yoff=20-penConfig.yfac*tempVal[0][1];
	
	LCD_Clear(White);//清屏
	LCD_DisplayString(24,110,"屏幕校准成功");
	save_adjdata();
	DelayMS(1000);
	LCD_Clear(White);//清屏	 	     
}
开发者ID:luckywqf,项目名称:STM32_mp3,代码行数:54,代码来源:touch.c

示例5: main

int main() 
{	   
    SystemInit(); 
		 
    /*Connect RS->P1_27, RW->P1_28, EN->P1_29 and data bus(D4:D7 - P1_16:P1_23)*/
    LCD_SetUp(P1_27,P1_28,P1_29,P1_16,P1_17,P1_18,P1_19,P1_20,P1_21,P1_22,P1_23);
    LCD_Init(2,16);
    
    LCD_DisplayString("Explore Embedded");
    LCD_DisplayString("Lcd 8-bit Mode");

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

示例6: ManualClockCalibration

/**
  * @brief  Calibration of External crystal oscillator manually
  * @param  None
  * @retval : None
  */
void ManualClockCalibration(void)
{
  UpDownIntOnOffConfig(ENABLE);
  RightLeftIntExtOnOffConfig(ENABLE);
  SelIntExtOnOffConfig(DISABLE);
  LCD_Clear(Blue2);
  BKP_TamperPinCmd(DISABLE);
  BKP_RTCOutputConfig(BKP_RTCOutputSource_CalibClock);
  LCD_DisplayString(Line1,Column5,"Calibration");
  LCD_DisplayString(Line3,Column0,"LSE/64 is available");
  LCD_DisplayString(Line4,Column0,"on PC13.Measure the");
  LCD_DisplayString(Line5,Column0,"the frequency and");
  LCD_DisplayString(Line6,Column0,"press Sel to proceed");
  
  while(ReadKey()!=SEL)
  {
  }
  
  LCD_Clear(Blue2);
  BKP_RTCOutputConfig(BKP_RTCOutputSource_None);
  LCD_DisplayString(Line1,Column4,"Please enter");
  LCD_DisplayString(Line2,Column2,"Calibration Value");
  LCD_DisplayCount(Line4,Column6,1,ArrayTime[0]+0x30);
  LCD_DisplayCount(Line4,Column7,0,ArrayTime[1]+0x30);
  LCD_DisplayCount(Line4,Column8,0,ArrayTime[2]+0x30);
  LCD_DisplayString(Line6,Column6,"(0-121)");
  LCD_SetBackColor(Green);
  SelIntExtOnOffConfig(ENABLE);
}
开发者ID:namnguyendsn,项目名称:jupiter_packet,代码行数:34,代码来源:clock_calendar.c

示例7: DisplayDate

/**
  * @brief Displays the Date(DD/MM/YY and DAY ) on LCD
  * @param None
  * @retval :None
  */
void DisplayDate(void)
{
  s_DateStructVar.Year=(BKP_ReadBackupRegister(BKP_DR4));
  s_DateStructVar.Month=(BKP_ReadBackupRegister(BKP_DR2));
  s_DateStructVar.Day=(BKP_ReadBackupRegister(BKP_DR3));
  LCD_DisplayChar(Line5,Column5,(s_DateStructVar.Day/10) + 0x30);
  LCD_DisplayChar(Line5,Column6,(s_DateStructVar.Day%10) + 0x30);
  LCD_DisplayString(Line5,Column8,MonthsNames[s_DateStructVar.Month-1]);
  LCD_DisplayChar(Line5,Column12,((s_DateStructVar.Year/1000) + 0x30));
  LCD_DisplayChar(Line5,Column13,((s_DateStructVar.Year/100)%10) + 0x30);
  LCD_DisplayChar(Line5,Column14,((s_DateStructVar.Year/10)%10) + 0x30);
  LCD_DisplayChar(Line5,Column15,(s_DateStructVar.Year%10) + 0x30);
  
  switch(WeekDay(s_DateStructVar.Year,s_DateStructVar.Month,s_DateStructVar.Day))
  {
    case 0: LCD_DisplayString(Line6,Column8,"Sun");
            break;
    case 1: LCD_DisplayString(Line6,Column8,"Mon");
            break;
    case 2: LCD_DisplayString(Line6,Column8,"Tue");
            break;
    case 3: LCD_DisplayString(Line6,Column8,"Wed");
            break;
    case 4: LCD_DisplayString(Line6,Column8,"Thu");
            break;
    case 5: LCD_DisplayString(Line6,Column8,"Fri");
            break;
    case 6: LCD_DisplayString(Line6,Column8,"Sat");
            break;
  }
}
开发者ID:namnguyendsn,项目名称:jupiter_packet,代码行数:36,代码来源:clock_calendar.c

示例8: prvSetupHardware

static void prvSetupHardware(void)
{
ErrorStatus OSC4MStartUpStatus01;	

	/* ST provided routine. */

	/* MRCC system reset */
	MRCC_DeInit();
	
	/* Wait for OSC4M start-up */
	OSC4MStartUpStatus01 = MRCC_WaitForOSC4MStartUp();
	
	if(OSC4MStartUpStatus01 == SUCCESS)
	{
		/* Set HCLK to 60MHz */
		MRCC_HCLKConfig(MRCC_CKSYS_Div1);
		
		/* Set CKTIM to 60MHz */
		MRCC_CKTIMConfig(MRCC_HCLK_Div1);
		
		/* Set PCLK to 30MHz */
		MRCC_PCLKConfig(MRCC_CKTIM_Div2);
		
		/* Enable Flash Burst mode */
		CFG_FLASHBurstConfig(CFG_FLASHBurst_Enable);
		
		/* Set CK_SYS to 60 MHz */
		MRCC_CKSYSConfig(MRCC_CKSYS_OSC4MPLL, MRCC_PLL_Mul_15);
	}
	
	/* GPIO pins optimized for 3V3 operation */
	MRCC_IOVoltageRangeConfig(MRCC_IOVoltageRange_3V3);
	
	/* GPIO clock source enable */
	MRCC_PeripheralClockConfig(MRCC_Peripheral_GPIO, ENABLE);
	
	/* EXTIT clock source enable */
	MRCC_PeripheralClockConfig(MRCC_Peripheral_EXTIT, ENABLE);
	/* TB clock source enable */
	MRCC_PeripheralClockConfig(MRCC_Peripheral_TB, ENABLE);
	
	/* Initialize the demonstration menu */
	LCD_Init();
	
	LCD_DisplayString(Line1, ( unsigned char * ) "www.FreeRTOS.org", BlackText);
	LCD_DisplayString(Line2, ( unsigned char * ) "  STR750 Demo  ", BlackText);
	
	EIC_IRQCmd(ENABLE);
}
开发者ID:denal05,项目名称:STM32L152-EVAL,代码行数:49,代码来源:main.c

示例9: lcdout_Tick

void lcdout_Tick(){
    //Actions
    switch(lcdout_state){
        case lcdout_INIT:
            break;
        case lcdout_RUN:
            lcd_output[11] = speed;
            lcd_output[27] = pattern;
            if (selected == 0) { 
                lcd_output[0] = '*';
                lcd_output[16] = ' ';
            } else if (selected == 1) {
                lcd_output[0] = ' ';
                lcd_output[16] = '*';
            }
            LCD_DisplayString(1,lcd_output);
            break;
        default:
            break;
    }
    //Transitions
    switch(lcdout_state){
        case lcdout_INIT:
            lcdout_state = lcdout_RUN;
            break;
        case lcdout_RUN:
            lcdout_state = lcdout_RUN;
            break;
        default:
            lcdout_state = lcdout_INIT;
            break;
    }
}
开发者ID:bradley-evans,项目名称:college-courses-repo,代码行数:33,代码来源:ex_1_master.c

示例10: menu

void menu() {
	switch(State3) {
		case Waitfor:
			if (holder == 0) {
				LCD_ClearScreen();
				LCD_DisplayString(1,"Press * for 1P  Press # for 2P");
				counter2++;
				if (z == '*') {
					holder = 1;
					srand(counter2);
					i = rand() % 5;
					a = rand() % 4;
					LCD_ClearScreen();
				}
				if (z == '#') {
					playertwochecker = 1;
					holder = 1;
					srand(counter2);
					i = rand() % 5;
					a = rand() % 4;
					LCD_ClearScreen();
				}
			}

			break;
	}
}
开发者ID:jpang007,项目名称:CS-Assignments,代码行数:27,代码来源:source.c

示例11: lcdDisplayTick

int lcdDisplayTick(task* t){

	//actions	
	switch(t->state){
		case lcd_init:
			LCD_init();							//initialize LCD
			LCD_ClearScreen();					//clear screen of any artifacts
			break;
		case s1:
			//LCD_ClearScreen();					//clear screen of any artifacts
			LCD_DisplayString(1,motionSensorMsg);	//display motion sensor message
			break;
		default:
			break;
	}

	//transitions
	switch(t->state){
		case lcd_init:
			t->state = s1;
			break;
		case s1:
			t->state = s1;
			break;
		default:
			break;
	}
}
开发者ID:dutchthomas,项目名称:cs122a,代码行数:28,代码来源:p1.c

示例12: prvLCDTask

void prvLCDTask( void * pvParameters )
{
xQueueHandle *pxLCDQueue;
xLCDMessage xReceivedMessage;
portCHAR *pcString;

	/* To test the parameter passing mechanism, the queue on which messages are
	received is passed in as a parameter even though it is available as a file
	scope variable anyway. */
	pxLCDQueue = ( xQueueHandle * ) pvParameters;

	LCD_Init();

	for( ;; )
	{
		/* Wait for a message to arrive. */
		if( xQueueReceive( *pxLCDQueue, &xReceivedMessage, portMAX_DELAY ) )
		{
			/* Where is the string we are going to display? */
			pcString = *xReceivedMessage.ppcMessageToDisplay;
  			LCD_DisplayString(xReceivedMessage.xRow, pcString, BlackText);

			/* The delay here is just to ensure the LCD task does not starve
			out lower priority tasks as writing to the LCD can take a long
			time. */
			vTaskDelay( mainLCD_DELAY );
		}
	}
}
开发者ID:svn2github,项目名称:freertos,代码行数:29,代码来源:main.c

示例13: LCD_DisplayInt

void LCD_DisplayInt(uint16_t LineNumber, uint16_t ColumnNumber, int Number)
{  
  //here the LineNumber and the ColumnNumber are NOT  pixel numbers!!!
		char lcd_buffer[15];
		sprintf(lcd_buffer,"%d",Number);
	
		LCD_DisplayString(LineNumber, ColumnNumber, (uint8_t *) lcd_buffer);
}
开发者ID:calcem,项目名称:Tron3TA4,代码行数:8,代码来源:main.c

示例14: main

/* start the main program */
void main() 
{

  /* Initilize the lcd before displaying any thing on the lcd */
    LCD_Init(8,2,16);

  /* Display "hello, world" on first line*/
  LCD_DisplayString("hello, world");

  /*Go to second line and display "good morning" */
  LCD_GoToNextLine();
  LCD_DisplayString("good morning");


  while(1);

  }
开发者ID:Amritach,项目名称:Code-Libraries,代码行数:18,代码来源:main.c

示例15: BSP_init

/*..........................................................................*/
void BSP_init(void) {

    SystemInit();         /* initialize STM32 system (clock, PLL and Flash) */

             /* initialize LEDs, Key Button, and LCD on STM3210X-EVAL board */
    STM_EVAL_LEDInit(LED1);
    STM_EVAL_LEDInit(LED2);
    STM_EVAL_LEDInit(LED3);
    STM_EVAL_LEDInit(LED4);

    STM3210C_LCD_Init();                              /* initialize the LCD */
    LCD_Clear(White);                                      /* clear the LCD */
    LCD_SetBackColor(Grey);
    LCD_SetTextColor(Black);
    LCD_DisplayString(Line0, 0, "   Quantum Leaps    ");
    LCD_DisplayString(Line1, 0, "     DPP example    ");
    LCD_DisplayString(Line2, 0, "QP/C(Vanilla)       ");
    LCD_DisplayString(Line2, 14*16, QF_getVersion());
    LCD_SetBackColor(White);
    LCD_DisplayString(Line5, 0, "DPP:");
    LCD_SetBackColor(Black);
    LCD_SetTextColor(Yellow);
    LCD_DisplayString(Line9, 0, "  state-machine.com ");
    LCD_SetBackColor(Blue);
    LCD_SetTextColor(White);
    LCD_DisplayString(Line5, 4*16, "0 ,1 ,2 ,3 ,4    ");

    if (QS_INIT((void *)0) == 0) {    /* initialize the QS software tracing */
        Q_ERROR();
    }
}
开发者ID:JigsawRenaissance,项目名称:GGHC,代码行数:32,代码来源:bsp.c


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