Eye Blink Sensor Essay

700 Words Oct 8th, 2013 3 Pages
#include<reg51F.h> // include P89V51rd2 SFR header file sbit LCD_RS = P1^6; // lcd command word/!data word select (register select) pin sbit LCD_RW = P1^5; // lcd read/!write pin (normally conn to gnd) sbit LCD_E = P1^7; // lcd enable pin sbit ROW4 = P0^7; // row 4 sbit ROW3 = P0^6; // row 3 sbit ROW2 = P0^5; // row 2 sbit ROW1 = P0^4; // row 1 sbit COL4 = P0^3; // col 4 sbit COL3 = P0^2; // col 3 sbit COL2 = P0^1; // col …show more content…
P2 = dw; LCD_E = 0; for( delay=0; delay<=250; delay++); } void lcd_init() // lcd initialisation { lcd_cw(0x38); // for( delay=0; delay<=250; delay++); lcd_cw(0xe); // for( delay=0; delay<=250; delay++); lcd_cw(0x6); // for( delay=0; delay<=250; delay++); lcd_cw(0x1); // for( delay=0; delay<=250; delay++); lcd_cw(0x80); // for( delay=0; delay<=250; delay++); } disp_enterword() // { lcd_cw(0xc0); for(i=0; i<16; i++) { dw = enterword[i]; lcd_dw(dw); } } keyscan() // in normal operation execute this loop in every 2 milli seconds {

P0 = 0xff; ROW1 = 0; if( COL1 == 0 ) // D key { keyflg = 1; key

Related Documents