예제 #1
0
void LCD_send_byte(char address, char Data) {
    LCD_RS_IO = address;

    LCD_DATA4_IO = ((Data & 0x10) == 0x10);
    LCD_DATA5_IO = ((Data & 0x20) == 0x20);
    LCD_DATA6_IO = ((Data & 0x40) == 0x40);
    LCD_DATA7_IO = ((Data & 0x80) == 0x80);

    LCD_E_IO = 1;
    Delay_(6);
    LCD_E_IO = 0;
    Delay_(6);

    Data = Data << 4;
    LCD_DATA4_IO = ((Data & 0x10) == 0x10);
    LCD_DATA5_IO = ((Data & 0x20) == 0x20);
    LCD_DATA6_IO = ((Data & 0x40) == 0x40);
    LCD_DATA7_IO = ((Data & 0x80) == 0x80);

    LCD_E_IO = 1;
    Delay_(6);
    LCD_E_IO = 0;
    ;
    Delay_(6);

}
예제 #2
0
/**电机初始化**/
void TestApp_Init(void)
{
  
   uint16 i;
   ES=0;
   for(i=0;i<18;i++)
   {
   	   LED1=~LED1;
	   Delay_(350);
	   LED2=~LED2;
	   Delay_(350);
	   LED3=~LED3;
	   Delay_(350);
	   LED4=~LED4;
	   Delay_(350);
	   LED5=~LED5;
	   Delay_(350);
	   LED6=~LED6;
	   Delay_(350);
		
   }

  for(i=0;i<15;i++)
   {
   	   LED1=~LED1;
	  // Delay_(350);
	   LED2=~LED2;
		// Delay_(350);
	   LED3=~LED3;
		//  Delay_(350);
       LED4=~LED4;
		//   Delay_(350);
       LED5=~LED5;
		  //  Delay_(350);
       LED6=~LED6;
	   Delay_(1000);
		
   }
   LED2=1;
   LED4=1;
   LED6=1;  	 
}