亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? flex_lcd420.c

?? ccs pic LCD420驅(qū)動(dòng) 用語(yǔ)PIC 單片機(jī)
?? C
字號(hào):
// Flex_LCD420.c

// These pins are for my Microchip PicDem2-Plus board,
// which I used to test this driver.
// An external 20x4 LCD is connected to these pins.
// Change these pins to match your own board's connections.

#define LCD_DB4   PIN_B4
#define LCD_DB5   PIN_B5
#define LCD_DB6   PIN_B6
#define LCD_DB7   PIN_B7

#define LCD_RS    PIN_B3
//#define LCD_RW    PIN_B0 it is earthed at the display
#define LCD_E     PIN_B2

/*
// To prove that the driver can be used with random
// pins, I also tested it with these pins:
#define LCD_DB4   PIN_D4
#define LCD_DB5   PIN_B1
#define LCD_DB6   PIN_C5
#define LCD_DB7   PIN_B5

#define LCD_RS    PIN_E2
#define LCD_RW    PIN_B2
#define LCD_E     PIN_D6
*/

// If you want only a 6-pin interface to your LCD, then
// connect the R/W pin on the LCD to ground, and comment
// out the following line.  Doing so will save one PIC
// pin, but at the cost of losing the ability to read from
// the LCD.  It also makes the write time a little longer
// because a static delay must be used, instead of polling
// the LCD's busy bit.  Normally a 6-pin interface is only
// used if you are running out of PIC pins, and you need
// to use as few as possible for the LCD.

//#define USE_RW_PIN   1     


// These are the line addresses for most 4x20 LCDs.
#define LCD_LINE_1_ADDRESS 0x00
#define LCD_LINE_2_ADDRESS 0x40
#define LCD_LINE_3_ADDRESS 0x14
#define LCD_LINE_4_ADDRESS 0x54

// These are the line addresses for LCD's which use
// the Hitachi HD66712U controller chip.
/*
#define LCD_LINE_1_ADDRESS 0x00
#define LCD_LINE_2_ADDRESS 0x20
#define LCD_LINE_3_ADDRESS 0x40
#define LCD_LINE_4_ADDRESS 0x60
*/


//========================================

#define lcd_type 2   // 0=5x7, 1=5x10, 2=2 lines(or more)

int8 lcd_line;

int8 const LCD_INIT_STRING[4] =
{
 0x20 | (lcd_type << 2),  // Set mode: 4-bit, 2+ lines, 5x8 dots
 0xc,                     // Display on
 1,                       // Clear display
 6                        // Increment cursor
 };
                             

//-------------------------------------
void lcd_send_nibble(int8 nibble)
{
// Note:  !! converts an integer expression
// to a boolean (1 or 0).
 output_bit(LCD_DB4, !!(nibble & 1));
 output_bit(LCD_DB5, !!(nibble & 2)); 
 output_bit(LCD_DB6, !!(nibble & 4));   
 output_bit(LCD_DB7, !!(nibble & 8));   

 delay_cycles(1);
 output_high(LCD_E);
 delay_us(2);
 output_low(LCD_E);
}

//-----------------------------------
// This sub-routine is only called by lcd_read_byte().
// It's not a stand-alone routine.  For example, the
// R/W signal is set high by lcd_read_byte() before
// this routine is called.     

#ifdef USE_RW_PIN
int8 lcd_read_nibble(void)
{
int8 retval;
// Create bit variables so that we can easily set
// individual bits in the retval variable.
#bit retval_0 = retval.0
#bit retval_1 = retval.1
#bit retval_2 = retval.2
#bit retval_3 = retval.3

retval = 0;
   
output_high(LCD_E);
delay_us(1);

retval_0 = input(LCD_DB4);
retval_1 = input(LCD_DB5);
retval_2 = input(LCD_DB6);
retval_3 = input(LCD_DB7);
 
output_low(LCD_E);
delay_us(1);
   
return(retval);   
}   
#endif

//---------------------------------------
// Read a byte from the LCD and return it.

#ifdef USE_RW_PIN
int8 lcd_read_byte(void)
{
int8 low;
int8 high;

output_high(LCD_RW);
delay_cycles(1);

high = lcd_read_nibble();

low = lcd_read_nibble();

return( (high<<4) | low);
}
#endif

//----------------------------------------
// Send a byte to the LCD.
void lcd_send_byte(int8 address, int8 n)
{
output_low(LCD_RS);

#ifdef USE_RW_PIN
while(bit_test(lcd_read_byte(),7)) ;
#else
delay_us(60); 
#endif

if(address)
   output_high(LCD_RS);
else
   output_low(LCD_RS);
     
 delay_cycles(1);

#ifdef USE_RW_PIN
output_low(LCD_RW);
delay_cycles(1);
#endif

output_low(LCD_E);

lcd_send_nibble(n >> 4);
lcd_send_nibble(n & 0xf);
}
//----------------------------

void lcd_init(void)
{
int8 i;

lcd_line = 1;

output_low(LCD_RS);

#ifdef USE_RW_PIN
output_low(LCD_RW);
#endif

output_low(LCD_E);

// Some LCDs require 15 ms minimum delay after
// power-up.  Others require 30 ms.  I'm going
// to set it to 35 ms, so it should work with
// all of them.
delay_ms(35);         

for(i=0 ;i < 3; i++)
   {
    lcd_send_nibble(0x03);
    delay_ms(5);
   }

lcd_send_nibble(0x02);

for(i=0; i < sizeof(LCD_INIT_STRING); i++)
   {
    lcd_send_byte(0, LCD_INIT_STRING[i]);
   
    // If the R/W signal is not used, then
    // the busy bit can't be polled.  One of
    // the init commands takes longer than
    // the hard-coded delay of 50 us, so in
    // that case, lets just do a 5 ms delay
    // after all four of them.
    #ifndef USE_RW_PIN
    delay_ms(5);
    #endif
   }

}

//----------------------------

void lcd_gotoxy(int8 x, int8 y)
{
int8 address;


switch(y)
  {
   case 1:
     address = LCD_LINE_1_ADDRESS;
     break;

   case 2:
     address = LCD_LINE_2_ADDRESS;
     break;

   case 3:
     address = LCD_LINE_3_ADDRESS;
     break;

   case 4:
     address = LCD_LINE_4_ADDRESS;
     break;

   default:
     address = LCD_LINE_1_ADDRESS;
     break;
     
  }

address += x-1;
lcd_send_byte(0, 0x80 | address);
}

//-----------------------------
void lcd_putc(char c)
{
 switch(c)
   {
    case '\f':
      lcd_send_byte(0,1);
      lcd_line = 1;
      delay_ms(2);
      break;
   
    case '\n':
       lcd_gotoxy(1, ++lcd_line);
       break;
   
    case '\b':
       lcd_send_byte(0,0x10);
       break;
   
    default:
       lcd_send_byte(1,c);
       break;
   }
}

//------------------------------
#ifdef USE_RW_PIN
char lcd_getc(int8 x, int8 y)
{
char value;

lcd_gotoxy(x,y);

// Wait until busy flag is low.
while(bit_test(lcd_read_byte(),7)); 

output_high(LCD_RS);
value = lcd_read_byte();
output_low(LCD_RS);

return(value);
}
#endif

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久噜噜亚洲综合| 欧美经典三级视频一区二区三区| 美女精品一区二区| 国产精品久久久久久福利一牛影视 | 91麻豆.com| 久久99久久99| 亚洲国产精品一区二区久久恐怖片| 久久久蜜桃精品| 欧美一区永久视频免费观看| 91在线观看污| 国产精品一区在线| 日本一不卡视频| 亚洲综合色成人| 国产精品久久久久久一区二区三区| 日韩精品一区二区三区在线观看| 欧美自拍丝袜亚洲| 97久久精品人人澡人人爽| 国产一区二区三区最好精华液| 无码av中文一区二区三区桃花岛| 中文字幕欧美一| 国产欧美日韩卡一| 精品成人免费观看| 日韩欧美专区在线| 91精品黄色片免费大全| 精品国产免费一区二区三区四区| 欧美日产国产精品| 在线观看日韩国产| 日本韩国精品一区二区在线观看| 成人自拍视频在线观看| 国产精品一区不卡| 国产一区二区三区免费看| 奇米四色…亚洲| 日本午夜精品一区二区三区电影| 亚洲高清不卡在线观看| 亚洲综合小说图片| 亚洲黄色录像片| 亚洲乱码一区二区三区在线观看| 中文字幕一区二区三区在线观看| 国产亚洲欧美在线| 国产精品天干天干在观线| 国产亚洲一本大道中文在线| 国产亚洲女人久久久久毛片| 久久久国产综合精品女国产盗摄| 国产亚洲欧美中文| 国产精品久久久久一区| 日韩一区在线看| 综合久久久久综合| 亚洲一区二区在线观看视频| 亚洲夂夂婷婷色拍ww47 | 蜜臀久久99精品久久久久宅男 | 色婷婷久久久亚洲一区二区三区| 99久久久无码国产精品| 91美女视频网站| 欧美在线999| 欧美日韩高清在线| 欧美一区二区三区系列电影| 日韩欧美一区二区免费| 久久亚洲一区二区三区明星换脸| 日本一区二区三区免费乱视频| 国产精品福利电影一区二区三区四区| 最好看的中文字幕久久| 国产福利精品一区二区| 国产东北露脸精品视频| 成人免费毛片片v| 一本大道久久a久久精品综合| 欧美日韩专区在线| 日韩写真欧美这视频| 久久精品网站免费观看| 亚洲色图第一区| 奇米影视一区二区三区| 国产成人av一区| 欧美体内she精高潮| 欧美电视剧免费观看| 国产精品免费av| 午夜精品国产更新| 国产大陆a不卡| 欧亚一区二区三区| 精品伦理精品一区| 亚洲欧美成aⅴ人在线观看| 日韩精品福利网| 成人晚上爱看视频| 欧美日本韩国一区| 欧美国产成人在线| 日本欧美肥老太交大片| 成人免费高清视频在线观看| 欧美日韩国产影片| 国产精品无圣光一区二区| 日韩av中文字幕一区二区| 成人激情免费视频| 日韩一区二区视频| 亚洲女与黑人做爰| 国产一区二区三区精品视频| 在线看一区二区| 久久午夜羞羞影院免费观看| 一区二区三区波多野结衣在线观看 | 亚洲人被黑人高潮完整版| 日本在线不卡视频一二三区| 成人免费视频视频在线观看免费 | 日本一区二区成人在线| 水野朝阳av一区二区三区| 成人99免费视频| 欧美videossexotv100| 伊人色综合久久天天| 国产乱子轮精品视频| 在线播放欧美女士性生活| 中文字幕中文字幕在线一区 | 国产精品自在在线| 欧美日韩亚洲综合一区 | 国产精品久久久久aaaa樱花| 免费成人在线观看| 91激情五月电影| 国产精品国产三级国产普通话99 | 欧美日韩成人一区| 国产精品国产三级国产aⅴ中文| 麻豆精品在线播放| 欧美精品1区2区3区| 亚洲男人的天堂网| 波多野结衣亚洲| 久久久www成人免费毛片麻豆| 奇米影视在线99精品| 欧美日韩卡一卡二| 亚洲一区二区在线观看视频| 日本久久一区二区| 亚洲三级电影全部在线观看高清| 成人中文字幕在线| 国产亚洲成年网址在线观看| 蜜桃视频一区二区三区| 91精品国产综合久久精品图片| 一区二区三区日韩欧美| 色婷婷av一区二区三区软件 | 秋霞午夜鲁丝一区二区老狼| 欧美中文字幕一区二区三区| 国产精品色婷婷久久58| 国产成人精品在线看| 国产免费成人在线视频| 国产一区二区在线观看视频| 精品国产乱码久久久久久牛牛| 美国三级日本三级久久99| 日韩亚洲欧美中文三级| 青草国产精品久久久久久| 91精品国产aⅴ一区二区| 日本成人在线一区| 欧美一级片免费看| 九色综合国产一区二区三区| 亚洲精品一区二区三区蜜桃下载| 精品一区二区三区免费| 久久综合九色综合欧美就去吻| 黄一区二区三区| 日本一区二区三区dvd视频在线| 岛国精品在线观看| 亚洲欧洲性图库| 欧美午夜影院一区| 日韩国产欧美在线观看| 欧美成人福利视频| 国产很黄免费观看久久| 国产精品三级av| 色94色欧美sute亚洲线路一ni| 一区2区3区在线看| 制服丝袜中文字幕亚洲| 麻豆国产欧美一区二区三区| 久久亚洲精品小早川怜子| 欧美丰满少妇xxxbbb| 国产精品99久久久久久久女警| 国产婷婷一区二区| 色先锋aa成人| 日韩影院在线观看| 国产欧美一区二区精品忘忧草| av在线不卡免费看| 亚洲午夜久久久久久久久电影院| 91麻豆精品91久久久久同性| 国内成人免费视频| 亚洲人一二三区| 欧美精品123区| 国产iv一区二区三区| 一区二区三区四区国产精品| 日韩一区二区视频在线观看| 国产成人精品www牛牛影视| 亚洲视频一区在线观看| 91精品国产免费| www.亚洲人| 男男成人高潮片免费网站| 国产精品伦理在线| 欧美丰满少妇xxxxx高潮对白| 国产成人综合精品三级| 亚洲国产aⅴ天堂久久| 久久久久久久久久电影| 欧美亚洲动漫精品| 国产精品99久久久久久有的能看 | 国产精品综合一区二区| 一区二区三区四区亚洲| 亚洲精品一区二区三区在线观看 | 亚洲妇女屁股眼交7| 久久精品一区二区三区四区| 欧美日韩一区二区在线视频| 国产二区国产一区在线观看| 视频一区二区欧美| 亚洲日本va午夜在线影院| 久久免费看少妇高潮| 欧美精品aⅴ在线视频| 99精品在线观看视频|