LCD Keypad Shield of the LCD1602 character LCD input and output expansion board For ARDUINO<\/p>\n
Specifications<\/strong><\/p>\n module : 20.5mmx41mm<\/p>\n the module weight : 57g<\/p>\n Introduction to 1602 – character LCD –\u00a01602LCD main technical parameters :<\/strong><\/p>\n <\/p>\n 1st feet : VSS for the power supply .<\/p>\n 2nd leg : VDD 5V power supply .<\/p>\n 3rd leg : VL LCD contrast adjustment end , followed by a positive contrast when the power of the weakest , grounding the contrast<\/p>\n The highest contrast ratio too high will have a ” ghosting ” , used by a 10K when the potentiometer to adjust the contrast .<\/p>\n 4th leg : RS to register choices , high level selection data , low level select instruction registers .<\/p>\n The 5th foot : r \/ w for read \/ write signal lines , high level for read operations , write low level . Dang RS<\/p>\n And R\/W work together to lower level instruction or the address could be written , when RS is higher for low level R\/W level<\/p>\n Busy signal can be read , as RS for high level R\/W for low level data can be written .<\/p>\n 6th leg : e end – for – end , when e duanyou – level jumps to a low level , LCD module executes the command .<\/p>\n Di7~14 feet : D0~D7 for 8 – bit bidirectional data line .<\/p>\n The 15th foot : cathode backlight .<\/p>\n The 16th foot : negative backlight .<\/p>\n 1602LCD command Description:<\/strong><\/p>\n 1602 LCD controller within the total 11 control orders, as shown in the table the following table:<\/p>\n Ordinal number instruction RS R\/W D7 D6 D5 D4 D3 D2 D1 D0<\/p>\n 1 Qing ping 0 0 0 0 0 0 0 0 0 1<\/p>\n 2 the cursor returns 0 0 0 0 0 0 0 0 1 *<\/p>\n 3 reset input mode 0 0 0 0 0 0 0 1 I\/D s<\/p>\n Display on\/off control 4 0 0 0 0 0 0 1 d c b<\/p>\n 5 character or cursor shifted 0 0 0 0 0 1 S\/C R\/L * *<\/p>\n 6 reset the function f * 0 0 0 0 1 DL n *<\/p>\n Character memory address 0 0 0 1 7 reset character memory address<\/p>\n 8 reset the data memory address 0 0 1 displays the data memory address<\/p>\n 9 0 1 BF counter read busy flag or address address<\/p>\n Write count to 10 or DDRAM CGRAM) 1 0 to write the contents of the data<\/p>\n 11 CGRAM or DDRAM reading 1 1 read out the contents of the data<\/p>\n 1602 LCD module, reading and writing, screen and cursor operations are achieved through the directive programming. (Note: 1 high, 0 is low level)<\/p>\n Instructions 1:<\/strong> clear display, order code 01H, reset the cursor position to the address 00H.<\/p>\n Instruction 2:<\/strong> reset the cursor, the cursor returns to the address 00H.<\/p>\n Order 3:<\/strong> cursor, and display mode settings I\/D: cursor moving direction, move high to the right, low level s to the left:<\/p>\n Move all text is left or right on the screen. High level represents effective, low level is not valid.<\/p>\n Instruction 4:<\/strong> display switch control. D: control of display on and off, high level open display, low power<\/p>\n Flat locked display c: controls the cursor on and off, high level indicates that a cursor, low level indicates no cursor b: control<\/p>\n Whether the cursor is flashing, flashing high level, low level does not Flash.<\/p>\n Directive 5:<\/strong> cursor or display SHIFT S\/C: text to display high level moves, low level mobile cursor.<\/p>\n Instruction 6:<\/strong> feature command DL: high level is a 4-bit bus, low level as an 8-bit bus n: low<\/p>\n Usually consist of a single display, high voltage dual line display f: low level display dot matrix characters 5×7, high voltage display<\/p>\n 5×10 dot matrix characters.<\/p>\n Directive 7:<\/strong> character generator RAM address settings.<\/p>\n Directive 8:\u00a0<\/strong>DDRAM address settings.<\/p>\n Directive 9:<\/strong> reading of busy signals and the cursor address BF: for free sign-bit, line busy module can’t get<\/p>\n Receive commands or data, if low level is not busy.<\/p>\n Directive 10:<\/strong> write data.<\/p>\n Directive 11:<\/strong> reading the data.<\/p>\n HD44780 compatible chip timeline is as follows:<\/p>\n Read I RS=L,R\/W=H,E=H o D0-D7= status word<\/p>\n Write commands RS=L,R\/W=L,D0-D7= script, e = high output pulse is not<\/p>\n Reading data input RS=H,R\/W=H,E=H output D0-D7= data<\/p>\n Write data entry RS=H,R\/W=L,D0-D7= data E= high output pulse is not<\/p>\n 1602LCD initialize (reset):<\/p>\n Delay 15mS<\/p>\n Writing instruction 38H (busy signal will not be detected)<\/p>\n Latency 5mS<\/p>\n Writing instruction 38H (busy signal will not be detected)<\/p>\n Latency 5mS<\/p>\n Writing instruction 38H (busy signal will not be detected)<\/p>\n Each subsequent write command, the read\/write data operations are required to detect busy signal<\/p>\n Written instructions 38H: display mode settings<\/p>\n Written instructions 08H: display off<\/p>\n Written instructions 01H: displays a clear screen<\/p>\n Written instructions 06H: displays the cursor settings<\/p>\n Writing instruction 0CH: displaying open and cursor settings<\/p>\n \/\/Key message<\/p>\n char msgs[5][15] = {“Right Key OK “,<\/p>\n “Up Key OK “,<\/p>\n “Down Key OK “,<\/p>\n “Left Key OK “,<\/p>\n “Select Key OK” };<\/p>\n int adc_key_val[5] ={30, 150, 360, 535, 760 };<\/p>\n int NUM_KEYS = 5;<\/p>\n int adc_key_in;<\/p>\n int key=-1;<\/p>\n int oldkey=-1;<\/p>\n void setup() {<\/p>\n pinMode(13, OUTPUT); \/\/we’ll use the debug LED to output a heartbeat<\/p>\n lcd.init();<\/p>\n \/\/optionally, now set up our application-specific display settings, overriding whatever the lcd did in lcd.init()<\/p>\n \/\/lcd.commandWrite(0x0F);\/\/cursor on, display on, blink on. (nasty!)<\/p>\n lcd.clear();<\/p>\n lcd.printIn(“KEYPAD testing… pressing”);<\/p>\n }<\/p>\n void loop() {<\/p>\n adc_key_in = analogRead(0); \/\/ read the value from the sensor<\/p>\n digitalWrite(13, HIGH);<\/p>\n key = get_key(adc_key_in); \/\/ convert into key press<\/p>\n if (key != oldkey) \/\/ if keypress is detected<\/p>\n {<\/p>\n delay(50); \/\/ wait for debounce time<\/p>\n adc_key_in = analogRead(0); \/\/ read the value from the sensor<\/p>\n key = get_key(adc_key_in); \/\/ convert into key press<\/p>\n if (key != oldkey)<\/p>\n {<\/p>\n oldkey = key;<\/p>\n if (key >=0){<\/p>\n lcd.cursorTo(2, 0); \/\/line=2, x=0<\/p>\n lcd.printIn(msgs[key]);<\/p>\n }<\/p>\n }<\/p>\n }<\/p>\n \/\/delay(1000);<\/p>\n digitalWrite(13, LOW);<\/p>\n }<\/p>\n \/\/ Convert ADC value to key number<\/p>\n int get_key(unsigned int input)<\/p>\n {<\/p>\n int k;<\/p>\n for (k = 0; k < NUM_KEYS; k++)<\/p>\n {<\/p>\n if (input < adc_key_val[k])<\/p>\n {<\/p>\n return k;<\/p>\n }<\/p>\n }<\/p>\n if (k >= NUM_KEYS)<\/p>\n k = -1; \/\/ No valid key pressed<\/p>\n return k;<\/p>\n }<\/p>\n LCD4Bit_mod.<\/p>\n <\/p>\n","protected":false},"excerpt":{"rendered":" LCD Keypad Shield of the LCD1602 character LCD input and output expansion board For ARDUINO Specifications module : 20.5mmx41mm the module weight : 57g Introduction to 1602 – character LCD –\u00a01602LCD main technical parameters : display capacity : 16×2 characters chip working voltage : 4.5-5.5V current : 2.0mA ( 5.0 V) module optimum working voltage […]<\/p>\n","protected":false},"featured_media":3124,"comment_status":"open","ping_status":"closed","template":"","meta":{"spay_email":""},"product_cat":[26],"product_tag":[424,423,426,425],"yoast_head":"\n\n
\n