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

C++ LCD_clear函数代码示例

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

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



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

示例1: execute_state_entry

void execute_state_entry(state_t state)
{
	switch(state)
	{

		case READY_STATE:
			LCD_clear();
			LCD_putsub("Wez go \ndo buzi");
			break;
		case DRINKING_STATE:
			led_on();
			LCD_clear();
			start_time_measurement();
			break;
		case VERIFICATION_STATE:
			verified_time = *get_current_time();
			LCD_display_time(&verified_time);
			verification_state_duration = 0u;
			break;
		case DISPLAY_STATE:
			stop_time_measurement();
			//led_on();
			led_flashing_duration = 0u;
			//LCD_display_time(get_current_time()); // drinking time end display
			break;
		case ADC_STATE:
			LCD_clear();
			break;

	}
	state_is_new = 0u;
}
开发者ID:mosiu,项目名称:lej_prototyp,代码行数:32,代码来源:STM.c


示例2: WaitButton

/*******************************************************************
* Function:			int waitButton(void)
* Input Variables:	none
* Output Return:	int
* Overview:			Use a comment block like this before functions
********************************************************************/
int WaitButton( void ) 
{
    BOOL btnState1, btnState2, btnState3;//local variables - button states
	//int rtnValue=0;//return the button value
	int rtnValue=0;

	LCD_clear();

	if((ATopstat.state=SUBSYS_OPEN))
	{
       		// Get switch states.
		btnState1 = ATTINY_get_SW_state( ATTINY_SW3 );
		btnState2 = ATTINY_get_SW_state( ATTINY_SW4 );
		btnState3 = ATTINY_get_SW_state( ATTINY_SW5 );
		//LCD_printf("btnStates: %d %d %d \n", btnState1, btnState2, btnState3);

		if( btnState1 == TRUE ) 
		{
			LCD_printf( "SW1: Pushed\n");
			// TMRSRVC_delay(500);//wait 1 s

	                // Assume the LED subsystem opened successfully.
        	        LED_set_pattern( 0b00100000 );//turn the red LED on
                	TMRSRVC_delay(500);//wait 2 seconds
               		LED_clr_pattern( 0b01000000 );//turn the green LED off
                	LED_clr_pattern( 0b00100000 );//turn the red LED off
			rtnValue=1;
			}//end if button 1 state open

		if( btnState2 == TRUE ) 
		{
			LCD_printf( "SW2: Pushed\n");
			// TMRSRVC_delay(500);//wait 1 s

	                // Assume the LED subsystem opened successfully.
        	        LED_set_pattern( 0b01000000 );//turn the green LED on
                	TMRSRVC_delay(500);//wait 2 seconds
                	LED_clr_pattern( 0b01000000 );//turn the green LED off
                	LED_clr_pattern( 0b00100000 );//turn the red LED off
			rtnValue=2;
		}//end if btn 2 open

		if ( btnState3 == TRUE ) 
		{
			LCD_printf( "SW3: Pushed\n");
			// TMRSRVC_delay(500);//wait 1 s

	                // Assume the LED subsystem opened successfully.
        	        LED_set_pattern( 0b01000000 );//turn the green LED on
                	LED_set_pattern( 0b00100000 );//turn the red LED on
                	TMRSRVC_delay(500);//wait 2 seconds
                	LED_clr_pattern( 0b01000000 );//turn the green LED off
                	LED_clr_pattern( 0b00100000 );//turn the red LED off
			rtnValue=3;
		}//end if btn 3 open
            	LCD_clear();
		return rtnValue;
	}//end AT while

}//end the WaitButton() function
开发者ID:ruffsl,项目名称:ECE425,代码行数:66,代码来源:CEEN_Interfaces.c


示例3: SERIAL_readDataBlock

void SERIAL_readDataBlock(uint8_t * data, uint16_t dataLength){
	uint8_t currentArray[8];
	uint8_t * current = &currentArray;
	int progress = 0;
	int oldprogress = 0;
	if(current == NULL){
		SERIAL_wait("null pointer");
	}
	int i;
	
	LCD_clear();
	LCD_write_int("%d", progress);
	for(i = 0; i < dataLength; i+=8){
		oldprogress = progress;
		progress = (int)(100*((float)i/dataLength));
		
		if(oldprogress != progress){
			LCD_clear();
			LCD_write_int("%d", progress);
		}
		
		SERIAL_read8Bytes(current);
		int j;
		for(j = i; j < i+8; j++){
			data[j] = current[j%8];
		}
	}
	
	data[dataLength] = '\0';
}
开发者ID:Nanor,项目名称:mbed-orchestra,代码行数:30,代码来源:john.c


示例4: main

//=============================================================================
int main(void)
{
  LIGHT_init();
  LCD_init();
  LIGHT_on();
  LCD_clear();
  BEEP_init();
  RTC_init();
  RTOS_init();
  RC5_Init();
  RC5_Reset();
  ENC_init();
  KBD_init();
  bmp180Init();
  dht22Init();
  rda5807Init();
  rda5807PowerOn();
  rda5807SetMute(1);
  ds18x20SearchDevices();
  LCD_goto(0, 0);
  LCD_puts("POGODNAY STATION");
  LCD_goto(0, 1);
  LCD_puts("  VERSION 1.0   ");
  _delay_ms(1000);
  LCD_clear();
  LCD_load_bignum();
  ds18x20Process();
  if (bmp180HaveSensor()) bmp180Convert();
  dht22Read();
#if (DEBUG == 1)
  if ((BUT_1_PINX & (1<<(BUT_1_PIN))) == 0) {
    _delay_ms(100);
    if ((BUT_1_PINX & (1<<(BUT_1_PIN))) == 0) {
      RTOS_setTask(EVENT_SET_STATE_OPTION, 0, 0);
      BEEP_beep();
	  while (((BUT_1_PINX & (1<<(BUT_1_PIN))) == 0)) { }
      BEEP_beep();
    }
  }
#else
  RTOS_setTask(EVENT_SET_STATE_OPTION, 0, 0);
  BEEP_beep();
#endif
  RTOS_setTaskFunc(set_blink, 0, 1000);      // моргание
  RTOS_setTaskFunc(KBD_scan, 0, 5);          // запускаем опрос кнопок
  RTOS_setTaskFunc(ENC_poll, 0, 1);          // запускаем опрос енкодера
  RTOS_setTaskFunc(RC5_scan, 0, 5);          // запускаем опрос RC5
  RTOS_setTask(EVENT_SET_SHOW, 0, 0);		 // запуск шоу
  sei(); 				        			 // Разрешили прерывания
  while(1) {
    RTOS_dispatchTask();    			     // Вызываем диспетчер в цикле.    
  }
}
开发者ID:andrewdoynikov,项目名称:PS_16x2,代码行数:54,代码来源:main.c


示例5: main

void main()
{	
	uchar *p;
	p="by Jasper";	
	Init();
	IsReset=0;
	IsReset=eeprom_read(100);
	
	if(!IsReset)										//首次进入输入密码和显示欢迎界面
	{
		Confirm();
		LCD_clear();
		delay_ms(200);
		LCD_write_str(5,0,"welcome");
	
		while(*p)									
		{
			LCD_write_char(i,1,*p);
			p++;
			i++;
			delay_ms(100);
		}
	}
	
													
	LCD_clear();										//正式进入系统
	LCD_write_str(0,0,"1bell2led3motor");				
	LCD_write_str(0,1,"4fix_password");
	
	while(1)
	{
		eeprom_write(100,0);
		if(select=='1')  								//蜂鸣器模式
		{
			LCD_clear();
			LCD_write_str(0,0,"buzz..send * or");
			LCD_write_str(0,1,"shutdown to exit");
			Bell();
		}
		
		if(select=='2')  LED(); 						//led模式
		
		if(select=='3')  Motor();						//电机模式
		
		if(select=='4')  Write_password();				//修改密码模式
		
	}
		
}
开发者ID:JasperWong,项目名称:StateMachine_Avr,代码行数:49,代码来源:main.c


示例6: Menu_Generic

void Menu_Generic(PVOID course, pOption options[], U8 sizeOf){
  pPercurso percurso = (pPercurso)course;
  U32 currentTime=rtc_getCurrentTime();
  U8 elapsedTime=0;
  U8 idx = 0,bidx = -1;
  KB_Key key;
  
  
  while(1){
    if (bidx != idx){
      LCD_clear();
      LCD_writeLine(0,"Press OK or Next");
      LCD_writeLine(1,options[idx].text);
      bidx = idx;
    }
    if (keyboard_hasKey()){
      currentTime=rtc_getCurrentTime();
      switch(key = keyboard_getBitMap()){
          case OK:
            options[idx].function(percurso);
            break;
          case RIGHT:
          case DOWN:
            idx = __FX0(idx,1,sizeOf); break;
          case LEFT:
          case UP:
            idx = __FX0(idx,-1,sizeOf);    break;
          case CANCEL:
            LCD_clear();
            return;  
          default:
              //do nothing
              break;
      }
      elapsedTime=0;
    }else{
      //no key
      elapsedTime ++;
      
      if(elapsedTime >__WAIT_PERIOD_30_Seconds__){
        LCD_clear(); 
        return;
      }
      timer_sleep_miliseconds(pTIMER1, 200);
    }
    WD_reset();
  }
}
开发者ID:masterzdran,项目名称:semestre5,代码行数:48,代码来源:Menu.c


示例7: DBG_debug_try

#if __NOT_IMPLEMENTED_YET
void DBG_debug_try(void)
{

    uint8_t i_ultra = 0;
    INIT_ultraPredef(i_ultra ,0);
    uint8_t ilcd = 0;

    S_dev_lcd* lcd_dev = &(predef_lcds[ilcd]);

    S_sensor_ultra* ultra = &(predef_ultras[i_ultra]);
    ULTRA_signalSend(ultra);
    while(1)
    {
        ultra->dist = 0;
        while( !gpio_get(ultra->rxport,ultra->rxpin) )
        {
            __asm__("nop");
        }
        while( gpio_get(ultra->rxport,ultra->rxpin) )
        {
            (ultra->dist)++;
        }

        //u30+4;u10+1
        ultra->dist *= 1.1;//1.111;//1.33333333;//(1 + 4.0/30);

        LCD_clear(r->lcd);
        fprintf(flcd, "dist[cm]=%.2f", ultra->dist/100);//ULTRA_getDist(i_ultra));
        mswait(500);
    }
开发者ID:gr4viton,项目名称:stm32-robotics,代码行数:31,代码来源:main_debug.c


示例8: Argument

/*--------------------------------------------------------------------------------------------------
  Name         :  LCD_init
  Description  :  LCD controller initialization.
  Argument(s)  :  None.
  Return value :  None.
--------------------------------------------------------------------------------------------------*/
void LCD_init ( void )
{


	DDRB |= (1<<PB0) | (1<<PB1) | (1<<PB2);

	CLEAR_RST_PIN;	//reset LCD
	_delay_ms(2);

	CLEAR_SCE_PIN;    //Enable LCD

	_delay_ms(2);
	SET_RST_PIN;

	SET_SCE_PIN;	//disable LCD

	LCD_writeCommand( 0x21 );  // LCD Extended Commands.
	LCD_writeCommand( 0x80 | 0x30);  // Set LCD Vop (Contrast).
	LCD_writeCommand( 0x04 );  // Set Temp coefficent.
	LCD_writeCommand( 0x13 );  // LCD bias mode 1:48.
	LCD_writeCommand( 0x20 );  // LCD Standard Commands, Horizontal addressing mode.
        LCD_writeCommand( 0x09 );  // all display segments on
        _delay_ms(500);
	LCD_writeCommand( 0x0c );  // LCD in normal mode.

	LCD_clear();

        _delay_ms(500);
}
开发者ID:simonfojtu,项目名称:room_thermostat,代码行数:35,代码来源:3310_routines.c


示例9: LCD_init

void LCD_init(void)
{
  
  LCDGPIO_init();//所需io初始化
  LCD_RST_L;     // 产生一个让LCD复位的低电平脉冲
  delay_1us();
  //  DELAY_MS(1) ;
  LCD_RST_H;
  
  LCD_CE_L;     // 关闭LCD
  delay_1us();
  //  DELAY_MS(1) ;
  LCD_CE_H;     // 使能LCD
  delay_1us();
  //  DELAY_MS(1) ;
  
  LCD_write_byte(0x21, 0);	// 使用扩展命令设置LCD模式
  LCD_write_byte(0xc8, 0);	// 设置液晶偏置电压
  LCD_write_byte(0x06, 0);	// 温度校正
  LCD_write_byte(0x13, 0);	// 1:48
  LCD_write_byte(0x20, 0);	// 使用基本命令,V=0,水平寻址
  LCD_clear();	           // 清屏
  LCD_write_byte(0x0c, 0);	// 设定显示模式,正常显示
  
  LCD_CE_L;      // 关闭LCD
}
开发者ID:abba18,项目名称:Freescale-car-for-photoelectricity,代码行数:26,代码来源:Nokia5110.c


示例10: setup_LCD

void setup_LCD() {
  uint8_t i;

  // wait 50ms for LCD to come up
  Delay(50);

  // reset pins to all 0
  send_LCD(0);
  DelayUS(4500);

  for(i = 0; i < 3; i++) { // try three times to set LCD into a known state (re-sync half-byte stream)
    // start by setting 8 bit mode
    send_halfbyte(LCD_FUNCTIONSET|LCD_8BITMODE);
    DelayUS(4500); // wait a minimum of 4.1ms
  }

  // set in 4 bit mode
  send_halfbyte(LCD_FUNCTIONSET|LCD_4BITMODE);

  // set # of lines, font size, etc
  send_byte(LCD_FUNCTIONSET|LCD_2LINE|LCD_4BITMODE|LCD_5x8DOTS, 0);

  // TODO: does this need a modifier?
  // turn on display
  send_byte(LCD_BACKLIGHT|LCD_DISPLAYON|LCD_CURSOROFF|LCD_BLINKOFF, 0);

  LCD_clear();

  // left to right
  send_byte(LCD_ENTRYMODESET|LCD_ENTRYLEFT|LCD_ENTRYSHIFTDECREMENT, 0);

  LCD_home();

  LCD_print_char('B');
}
开发者ID:idaohang,项目名称:usb-gps,代码行数:35,代码来源:lcd.c


示例11: LCD_write_byte

void LCD4884::LCD_init(void) {
	CTick to;

	for (int i = 0; i < 6; i++) {
		lcd[i].output(NOT_OPEN); // set lcd I/F as output pins
		if ( i==SPI_SCK ) {
			lcd[i] = HIGH;
		} else {
			lcd[i] = LOW;
		}
	}

	lcd[LCD_RST] = LOW;
	to.delay(2);
	lcd[LCD_RST] = HIGH;

	lcd[SPI_CS] = LOW;
	to.delay(2);
	lcd[SPI_CS] = HIGH;
	to.delay(2);
	lcd[LCD_BL] = HIGH;

	LCD_write_byte(0x21, 0);
	LCD_write_byte(0xc0, 0);
	LCD_write_byte(0x06, 0);
	LCD_write_byte(0x13, 0);
	LCD_write_byte(0x20, 0);
	LCD_clear();
	LCD_write_byte(0x0c, 0);

//	lcd[SPI_CS] = HIGH;
}
开发者ID:brucetsao,项目名称:nano1768,代码行数:32,代码来源:LCD4884.cpp


示例12: LCD_init

void LCD_init(void)
{
	_delay_ms(50);
	
	// 연결 핀을 출력으로 설정
	if(MODE == 8) DDR_DATA |= 0xFF;
	else DDR_DATA |= 0xF0;
	
	DDR_CONTROL |= (1 << RS_PIN) | (1 << E_PIN);

	if(MODE == 8)
	LCD_write_command(COMMAND_8_BIT_MODE);		// 8비트 모드
	else{
		LCD_write_command(0x02);				// 4비트 모드 추가 명령
		LCD_write_command(COMMAND_4_BIT_MODE);		// 4비트 모드
	}

	// display on/off control
	// 화면 on, 커서 off, 커서 깜빡임 off
	uint8_t command = 0x08 | (1 << COMMAND_DISPLAY_ON_OFF_BIT);
	LCD_write_command(command);

	LCD_clear();	// 화면 지움

	// Entry Mode Set
	// 출력 후 커서를 오른쪽으로 옮김, 즉, DDRAM의 주소가 증가하며 화면 이동은 없음
	LCD_write_command(0x06);
}
开发者ID:Jpub,项目名称:ATmega328Programming,代码行数:28,代码来源:TEXT_LCD.c


示例13: main

int main(void)
{
LCD_init();
LCD_clear();
while(1)
{
uchar i;
LCD_write_english_string(3,0,"WXJ_PCR");
LCD_write_english_string(0,2,"TIME=");
LCD_write_num(5,2,31,2);
LCD_write_english_string(7,2,":");
LCD_write_num(8,2,43,2);
LCD_write_english_string(0,4,"NOW TEMP=");
LCD_write_english_string(0,3,"AIM TEMP=");
LCD_write_num(9,3,97,2);
LCD_write_english_string(11,4,".");
LCD_write_english_string(0,5,"COUNT=");
LCD_write_num(6,5,13,2);
LCD_write_english_string(8,5,":");
LCD_write_num(9,5,35,2);
temp = get_tmp();
sendchangecmd();
for(i=0;i<40;i++)
{
display(temp);
}

}
}
开发者ID:wuxiaojiang,项目名称:PCR_project,代码行数:29,代码来源:main.c


示例14: display_idle

/*******************************************************************************
 * Zobrazeni casu na displeji
*******************************************************************************/
int display_idle()
{
    long microseconds, milliseconds, seconds, minutes, hours;
    char buf[20];

    if (isrunning)
        t = get_time();

    microseconds = (long)(((float)(t - t0))*TIMER_TICK);
    milliseconds = (long)(microseconds / 1000) % 1000;
    seconds = (((long)(microseconds / 1000) - milliseconds) / 1000) % 60;
    minutes = (((((long)(microseconds / 1000) - milliseconds) / 1000) - seconds) / 60) % 60;
    hours = ((((((long)(microseconds / 1000) - milliseconds) / 1000) - seconds) / 60) - minutes) / 60;

    if (hours < 10) {
        buf[0] = '0';
        long2str(hours, &buf[1], 10);
    }
    else {
        long2str(hours, &buf[0], 10);
    }
    buf[2] = ':';

    if (minutes < 10) {
        buf[3] = '0';
        long2str(minutes, &buf[4], 10);
    }
    else {
        long2str(minutes, &buf[3], 10);
    }
    buf[5] = ':';

    if (seconds < 10) {
        buf[6] = '0';
        long2str(seconds, &buf[7], 10);
    }
    else {
        long2str(seconds, &buf[6], 10);
    }
    buf[8] = '.';

    if (milliseconds < 10) {
        buf[9] = '0';
        buf[10] = '0';
        long2str(milliseconds, &buf[11], 10);
    }
    else if (milliseconds < 100) {
        buf[9] = '0';
        long2str(milliseconds, &buf[10], 10);
    }
    else {
        long2str(milliseconds, &buf[9], 10);
    }
    buf[12] = '\0';

    LCD_clear();
    LCD_append_string(buf);

    return 0;
}
开发者ID:zcsevcik,项目名称:edu,代码行数:63,代码来源:main.c


示例15: LCD_init

void LCD_init(void)
{
    GPIO_WriteBit(GPIOC,GPIO_Pin_7,Bit_SET);//LCD_RST = 0;
    // 产生一个让LCD复位的低电平脉冲
    GPIO_WriteBit(GPIO_LCD_RST_PORT,GPIO_LCD_RST,Bit_RESET);//LCD_RST = 0;
    delay_1us();

    GPIO_WriteBit(GPIO_LCD_RST_PORT,GPIO_LCD_RST,Bit_SET);//LCD_RST = 1;

    // 关闭LCD
    GPIO_WriteBit(GPIO_LCD_CE_PORT,GPIO_LCD_CE,Bit_RESET);//LCD_CE = 0;
    delay_1us();
    // 使能LCD
    GPIO_WriteBit(GPIO_LCD_CE_PORT,GPIO_LCD_CE,Bit_SET);//LCD_CE = 1;
    delay_1us();

    LCD_write_byte(0x21, 0);	// 使用扩展命令设置LCD模式
    LCD_write_byte(0xc8, 0);	// 设置偏置电压
    LCD_write_byte(0x06, 0);	// 温度校正
    LCD_write_byte(0x13, 0);	// 1:48
    LCD_write_byte(0x20, 0);	// 使用基本命令
    LCD_clear();	        // 清屏
    LCD_write_byte(0x0c, 0);	// 设定显示模式,正常显示

    // 关闭LCD
    GPIO_WriteBit(GPIO_LCD_CE_PORT,GPIO_LCD_CE,Bit_RESET);//LCD_CE = 0;
}
开发者ID:haodoan,项目名称:GPS_Tracking_STM32,代码行数:27,代码来源:nokia_5110.c


示例16: initLCD

void initLCD(void)
{
        //PORT configuration
        TRISB = 0x00;
        TRISD=0x00;
        //////////////////
        
        LCD_Write(0x38,0);    
        delay_ms(1);
        LCD_Write(0x0c,0);    //dispaly on , cursor blinking
        delay_ms(1);
        LCD_Write(0x01,0);    // clear dispaly screen
        
        
        delay_ms(1);
        LCD_Write(0x06,0);
//        LCD_Write(0x0F,0);                //blinking cursor
        delay_ms(1);
        LCD_clear();
        LCD_goto(1,0);
        
        LCD_Write('C',1);delay_ms(100);LCD_Write('l',1);delay_ms(100);
        LCD_Write('o',1);delay_ms(100);LCD_Write('c',1);delay_ms(100);
        LCD_Write('k',1);delay_ms(100);
        

        
        
}
开发者ID:manoja328,项目名称:myavr,代码行数:29,代码来源:lcd.c


示例17: mine_init

void mine_init(void){
    unsigned char x, y;
    Func_id = MINE;

    mine_notdig_count = MINE_ROW * MINE_COL;
    mine_count = 0;
    mine_start_time = Timer_stamp_ms;
    mine_time = 0;
    mine_x = 0;
    mine_y = 0;
    mine_isover = 0;
    mine_success = 0;

    srand(Timer_stamp_ms);
    for(x = 0; x < MINE_COL; ++x){
        for(y = 0; y < MINE_ROW; ++y){
            if((rand() % 8 == 1)){ // 大于 100 表示是一个雷, 1 / 8 概率
                mine_map[x][y] = 110;
                ++mine_count;
            }else{
                mine_map[x][y] = 10;
            }
        }
    }

    LCD_clear();
    mine_draw();
}
开发者ID:purocean,项目名称:Ybox,代码行数:28,代码来源:mine.c


示例18: pinMode

void LCD4884::LCD_init(void)
{
	for(int i = 2; i < 8; i++)	
	{
		pinMode(i,OUTPUT);
		digitalWrite(i,LOW);
	}

	digitalWrite(LCD_RST,LOW);
	delayMicroseconds(1);
	digitalWrite(LCD_RST,HIGH);
	
	digitalWrite(SPI_CS,LOW);
	delayMicroseconds(1);
	digitalWrite(SPI_CS,HIGH);
	delayMicroseconds(1);
	digitalWrite(LCD_BL,HIGH);

	LCD_write_byte(0x21, 0);
	LCD_write_byte(0xc0, 0);
	LCD_write_byte(0x06, 0);
    LCD_write_byte(0x13, 0);
    LCD_write_byte(0x20, 0);
	LCD_clear();
	LCD_write_byte(0x0c, 0);
	
	digitalWrite(SPI_CS,LOW);
}
开发者ID:CDobeck,项目名称:ArduinoSketchbook,代码行数:28,代码来源:LCD4884.cpp


示例19: CBOT_main

// ============================ CBOT_main =================================== //
void CBOT_main(void) {
	unsigned char sensors;

	// Initialize.
	init_bot();

	// Clear the screen.
	LCD_clear();

	printMainMenu();
	while (1) {
        // Delay a little so that the 'Tiny is not overwhelmed with requests.
        TMRSRVC_delay( 100 ); // Wait 100ms.

        // Get state of all sensors.
        sensors = ATTINY_get_sensors();
        if ( sensors & SNSR_SW3_EDGE ) {
                SPKR_play_tone( SPKR_FREQ( 293.7 ), 250, 80 );
                all_pixel_test();
                printMainMenu();
        } else if ( sensors & SNSR_SW4_EDGE ) {
                SPKR_play_tone( SPKR_FREQ( 440 ), 250, 80 );
                pixel_sensor_test();
                printMainMenu();
        } else if ( sensors & SNSR_SW5_EDGE ) {
                SPKR_play_tone( SPKR_FREQ( 659.3 ), 250, 80 );
				draw_smiley();
                printMainMenu();
        }
	}
}
开发者ID:ruffsl,项目名称:ECE425,代码行数:32,代码来源:Pixel_Demo.c


示例20: draw_smiley

// a function to draw a smiley face
void draw_smiley (void){

	int num = 0;
	while(checkNoBtns()) 
	{
		TMRSRVC_delay(100);
		LCD_clear();

		if (num % 2==0)
		{
			draw_face();
			draw_smile();
			TMRSRVC_delay(2000);
		}
		else
		{
			draw_face();
			draw_frown();
			TMRSRVC_delay(2000);
		}

		num++;

		for(unsigned char row = 0; row < LCD_PIX_HEIGHT; row++)
		{
			for( unsigned char col = 0; col < LCD_PIX_WIDTH; col++ )
			{
				LCD_set_pixel(row, col, 0);
			}
		}
	}
}
开发者ID:ruffsl,项目名称:ECE425,代码行数:33,代码来源:Pixel_Demo.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ LCD_init函数代码示例发布时间:2022-05-30
下一篇:
C++ LCD_WriteRAM函数代码示例发布时间: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